##### Differences

This shows you the differences between two versions of the page.

 cs-142:new-school-vectors [2014/10/23 15:08]kseppi cs-142:new-school-vectors [2014/10/23 18:43] (current)kseppi Both sides previous revision Previous revision 2014/10/23 18:43 kseppi 2014/10/23 15:08 kseppi 2014/10/21 15:05 kseppi 2014/10/21 14:40 kseppi created 2014/10/23 18:43 kseppi 2014/10/23 15:08 kseppi 2014/10/21 15:05 kseppi 2014/10/21 14:40 kseppi created Line 105: Line 105: cout << firstdata[i] << " "; cout << firstdata[i] << " "; } } + cout << endl; cout << "Here is what is in seconddata:"​ << endl; cout << "Here is what is in seconddata:"​ << endl; Line 110: Line 111: cout << seconddata[i] << " "; cout << seconddata[i] << " "; } } + cout << endl; // Copying Vectors is easier // Copying Vectors is easier Line 118: Line 120: cout << seconddata[i] << " "; cout << seconddata[i] << " "; } } + cout << endl; // we can also iterate over pointers to the data in the vector // we can also iterate over pointers to the data in the vector Line 125: Line 128: cout << *i << " "; cout << *i << " "; } } + cout << endl; cout << "​\nThis works and is easier to write:​\n";​ cout << "​\nThis works and is easier to write:​\n";​ Line 131: Line 135: cout << i << " "; cout << i << " "; } } + cout << endl; vector<​int>​ data = { 1, 2 }; vector<​int>​ data = { 1, 2 }; Line 166: Line 171: promptandadd(books);​ promptandadd(books);​ + cout << endl; cout << "Added a few more books\n";​ cout << "Added a few more books\n";​ 