added auto and loops
This commit is contained in:
parent
de20fd4ff3
commit
db5f9714a5
25
auto.cc
Normal file
25
auto.cc
Normal 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
21
loops.cc
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user