2012-05-05 08:01:40 -07:00
|
|
|
#include <string>
|
2012-05-05 13:54:38 -07:00
|
|
|
#include <iostream>
|
2012-05-25 07:17:47 -07:00
|
|
|
#include <vector>
|
2012-05-05 08:01:40 -07:00
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
struct Point {
|
|
|
|
int x, y;
|
|
|
|
Point(int x, int y): x(x), y(y){}
|
|
|
|
};
|
|
|
|
|
2012-05-25 07:17:47 -07:00
|
|
|
// const vector<string> v = ??; // wat
|
2012-05-05 08:01:40 -07:00
|
|
|
// http://stackoverflow.com/a/4268956
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
string s1("first");
|
2012-05-05 12:45:49 -07:00
|
|
|
string s3 = string("again");
|
2012-05-05 08:01:40 -07:00
|
|
|
int x = int(42);
|
|
|
|
string s2 = "hello";
|
|
|
|
int y = 42;
|
2012-05-05 13:54:38 -07:00
|
|
|
cout << x << " " << y << " " << endl;
|
2012-05-25 07:17:47 -07:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2012-05-05 08:01:40 -07:00
|
|
|
return 0;
|
|
|
|
}
|