Created
December 13, 2012 15:05
-
-
Save y2q-actionman/4276972 to your computer and use it in GitHub Desktop.
vector initialize in C++11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
int main(){ | |
// 1,2,3,4,5 を持った vector | |
std::vector<int> hoge{1, 2, 3, 4, 5}; | |
for(auto i : hoge){ | |
std::cout << i << " "; | |
} | |
std::cout << '\n'; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment