[ create a new paste ] login | about

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

C++, pasted on Jan 20:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include <iterator>
#include <vector>
 
int main() 
{
    std::vector<int> v{ 3, 1, 4 };
 
    auto it = v.begin();
 
    auto nx = std::next(it, 2);
 
    std::cout << *it << ' ' << *nx << '\n';
}


Output:
1
2
3
In function 'int main()':
Line 7: error: a function-definition is not allowed here before '{' token
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: