Skip to content

Instantly share code, notes, and snippets.

@y2q-actionman
Created December 13, 2012 15:05
Show Gist options
  • Save y2q-actionman/4276972 to your computer and use it in GitHub Desktop.
Save y2q-actionman/4276972 to your computer and use it in GitHub Desktop.
vector initialize in C++11
#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