[ create a new paste ] login | about

Link: http://codepad.org/TJAisZP0    [ raw code | output | fork ]

C++, pasted on May 24:
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>
#include <vector>

int main()
{
  vector <int> a = {1, 2, 3, 4, 5};
  for (size_t i = 0; i < a.size(); ++i)
{
cout << a[i] <<endl;
}
 return 0;
}


Output:
1
2
3
In function 'int main()':
Line 6: error: scalar object 'a' requires one element in initializer
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: