fork download
  1. #include <vector>
  2. #include <algorithm>
  3. #include <iostream>
  4. #include <iterator>
  5.  
  6. int main() {
  7. vector<int> v = {5, 2, 7};
  8. sort(v.begin(), v.end());
  9. copy(v.begin(), v.end(), std::ostream_iterator<int>(std::cout, " "));
  10. return 0;
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:7:3: error: ‘vector’ was not declared in this scope
prog.cpp:7:3: note: suggested alternative:
In file included from /usr/include/c++/4.7/vector:65:0,
                 from prog.cpp:1:
/usr/include/c++/4.7/bits/stl_vector.h:208:11: note:   ‘std::vector’
prog.cpp:7:10: error: expected primary-expression before ‘int’
prog.cpp:7:10: error: expected ‘;’ before ‘int’
prog.cpp:8:8: error: ‘v’ was not declared in this scope
prog.cpp:8:26: error: ‘sort’ was not declared in this scope
prog.cpp:8:26: note: suggested alternative:
In file included from /usr/include/c++/4.7/algorithm:63:0,
                 from prog.cpp:2:
/usr/include/c++/4.7/bits/stl_algo.h:5499:5: note:   ‘std::sort’
stdout
Standard output is empty