1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
//Int array
int arrayInts[5] = {1,2,3,4,5};
// or
string arrayInts2[] = {1,2,3,4,5,6,7,8,,4,3};
//Double Array
double arrayDbles[5] = {4.2, 6.7 };
//String Array
string arrayStr[] = {"One","two","three"};
// How to output an Array
cout << arrayInts[0] << endl; // this prints the first int in the array
cout << arrayInts[1] << endl; // prints second int in array
|