updated for presentation
This commit is contained in:
@@ -14,18 +14,11 @@ const vector<string> mcquays = {
|
||||
|
||||
|
||||
int main() {
|
||||
for(auto name: mcquays) {
|
||||
cout << name << endl;
|
||||
}
|
||||
// original with uint
|
||||
// original with iterator
|
||||
|
||||
vector<int> nums = { 1, 2, 3, 4, 5 };
|
||||
for(auto & n: nums) {
|
||||
n--;
|
||||
}
|
||||
|
||||
for(auto n: nums) {
|
||||
cout << n << endl;
|
||||
}
|
||||
// fix so nums is 0, 1, 2 ...
|
||||
|
||||
map<string, int> age_for_mcquay = {
|
||||
{"stephen", 31},
|
||||
@@ -34,7 +27,5 @@ int main() {
|
||||
{"derek", 21},
|
||||
};
|
||||
|
||||
for(auto p: age_for_mcquay) {
|
||||
cout << p.first << " " << p.second << endl;
|
||||
}
|
||||
// map example:
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user