
















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Motivation, Prints an array, Integer elements, Array of characters, Array of doubles, Array of integers, Wraps arrays, Arrays of boolean variables, Generic Programming are the points you can learn in this object oriented programming subject.
Typology: Slides
1 / 24
This page cannot be seen from the preview
Don't miss anything!

















void printArray(int* array, int size) { for ( int i = 0; i < size; i++ ) cout << array[ i ] << “, ”; }
void printArray(double* array, int size) { for ( int i = 0; i < size; i++ ) cout << array[ i ] << “, ”; }
class Array { double* pArray; int size; public: … };
class Array { bool* pArray; int size; public: … };
template< class T > void funName( T x ); // OR template< typename T > void funName( T x ); // OR template< class T, class U, … > void funName( T x, U y, … );
int main() { int iArray[5] = { 1, 2, 3, 4, 5 }; void printArray( iArray, 5 ); // Instantiated for int[] char cArray[3] = { ‘a’, ‘b’, ‘c’ }; void printArray( cArray, 3 ); // Instantiated for char[] return 0; }
template
int main() { int x; x = getInput< int >(); double y; y = getInput< double >(); }