Differences

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

Link to this comparison view

cs-142:student-vectors [2014/10/23 16:37] (current)
kseppi created
Line 1: Line 1:
 +<code cpp>
 +#include <​iostream>​
 +#include <​vector>​
 +#include <​string>​
  
 +using namespace std;
 +
 +int main() {
 +
 + vector<​int>​ ids;
 + vector<​string>​ names;
 +
 + ids.push_back(1);​
 + names.push_back("​Nick"​);​
 +
 + ids.push_back(2);​
 + names.push_back("​Connor"​);​
 +
 + for (auto student : ids) {
 + cout << student << ", ";
 + }
 + cout << endl;
 +
 + system("​pause"​);​
 + return(0);
 +}
 +</​code>​
cs-142/student-vectors.txt ยท Last modified: 2014/10/23 16:37 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