#include #include using namespace std; int main() { char myChars[] = {'B','a','r','b'}; cout << "myChars[2]= " << myChars[2] << endl; cout << "The whole char array = " << myChars << endl; // a strings is a char array string myName = "Barb"; // this is same as char array above cout << "myName[2]= " << myName[2] << endl; cout << "The whole string is = " << myName << endl; string testing; testing = myChars; cout << "Testing = " << testing << endl; int i[5]; // arrays always start with 0 i[0] = 1; i[1] = 2; i[2] = 3; i[3] = 4; i[4] = 5; cout << "Item 1 is " << i << endl; // a faster way int myOtherInts[5] = {2, 4, 6, 8, 10}; // initializes all at once cout << myOtherInts[4] << endl; // prints out 3 int anotherIntArray[100]; for (int c = 0; c<100; c++) { anotherIntArray[c] = c*2; } cout << "Item 49: " << anotherIntArray[99] << endl; cout << "Will this work? " << anotherIntArray[10-5] << endl; for (int l = 0; l < 4; l++) { for (int d = 0; d < 4; d++) { for (int a = 0; a < 4; a++) { cout << "Numbers are: " << l << " and " << a << " and " << d << endl; } } } int myDouble[4][3]; myDouble[0][0] = 12; myDouble[1][0] = 20; cout << "[0][0] = " << myDouble [0][0] << endl; return 0; }