added auto and loops

This commit is contained in:
Stephen M. McQuay 2012-05-05 13:45:44 -06:00
parent de20fd4ff3
commit db5f9714a5
2 changed files with 46 additions and 0 deletions

25
auto.cc Normal file
View File

@ -0,0 +1,25 @@
#include <vector>
#include <string>
#include <iostream>
const std::vector<std::string> mcquays = {
"stephen",
"michael",
"bryan",
"derek",
};
int func() {
return 42;
}
int main() {
auto i = 5;
auto j = func();
auto s = std::string{"hello world"};
for(auto it = mcquays.begin();
it != mcquays.end(); it++) {
std::cout << *it << std::endl;
}
}

21
loops.cc Normal file
View File

@ -0,0 +1,21 @@
#include <string>
#include <vector>
#include <iostream>
using namespace std;
const vector<string> mcquays = {
"stephen",
"michael",
"bryan",
"derek",
};
// const vector<int> nums = { 1, 2, 3, 4, 5 };
int main() {
// iterate over mcquay boys
// iterate over nums
// correct numbers
}