updated for presentation
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
struct Point {
|
||||
@@ -7,7 +8,7 @@ struct Point {
|
||||
Point(int x, int y): x(x), y(y){}
|
||||
};
|
||||
|
||||
// const vector<string> v = ??;
|
||||
// const vector<string> v = ??; // wat
|
||||
// http://stackoverflow.com/a/4268956
|
||||
|
||||
int main() {
|
||||
@@ -17,5 +18,12 @@ int main() {
|
||||
string s2 = "hello";
|
||||
int y = 42;
|
||||
cout << x << " " << y << " " << endl;
|
||||
|
||||
string names[] = {"stephen", "michael", "bryan", "derek"};
|
||||
vector<string> names_v (names, names + 3);
|
||||
// what is the bug here?
|
||||
for(unsigned int i = 0; i < names_v.size(); i++) {
|
||||
cout << names_v[i] << endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user