cpp11/loops.cc

32 lines
503 B
C++
Raw Permalink Normal View History

2012-05-05 12:45:44 -07:00
#include <string>
#include <vector>
2012-05-05 13:05:47 -07:00
#include <map>
2012-05-05 12:45:44 -07:00
#include <iostream>
using namespace std;
const vector<string> mcquays = {
"stephen",
"michael",
"bryan",
"derek",
};
int main() {
2012-05-25 07:17:47 -07:00
// original with uint
// original with iterator
2012-05-05 12:45:44 -07:00
2012-05-05 13:05:47 -07:00
vector<int> nums = { 1, 2, 3, 4, 5 };
2012-05-25 07:17:47 -07:00
// fix so nums is 0, 1, 2 ...
2012-05-05 13:05:47 -07:00
map<string, int> age_for_mcquay = {
{"stephen", 31},
{"michael", 29},
{"bryan", 27},
{"derek", 21},
};
2012-05-25 07:17:47 -07:00
// map example:
2012-05-05 12:45:44 -07:00
}