Differences

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

Link to this comparison view

cs-142:simple-students [2014/10/23 15:22] (current)
kseppi created
Line 1: Line 1:
 +<code c++>
 +#include <​iostream>​
 +#include <​string>​
 +#include <​vector>​
  
 +using namespace std;
 +
 +class student {
 +public:
 + int id;
 + string name;
 +};
 +
 +int main()
 +{
 + student my_son;
 + my_son.id = 1;
 +
 + vector<​student>​ students;
 +
 + // add one
 +
 + students.push_back(my_son);​
 +
 + for (auto stu : students) {
 + cout << stu.id << " is " << stu.name << endl;
 + }
 +
 +
 + system("​pause"​);​
 +}
 +</​code>​
cs-142/simple-students.txt ยท Last modified: 2014/10/23 15:22 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