Differences

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

Link to this comparison view

Both sides previous revision Previous revision
cs-142:new-school-vectors [2014/10/23 15:08]
kseppi
cs-142:new-school-vectors [2014/10/23 18:43] (current)
kseppi
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";​
  
cs-142/new-school-vectors.txt ยท Last modified: 2014/10/23 18:43 by kseppi
Back to top
CC Attribution-Share Alike 4.0 International
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0