fork download
  1. #include <array>
  2. #include <time.h>
  3. #include <vector>
  4. using namespace std;
  5. int main()
  6. {
  7. vector<int> myvector;
  8. srand((unsigned)time(NULL));
  9. for (int i=0; i<10; ++i)
  10. {myvector.push_back(i);}
  11. random_shuffle ( myvector.begin(), myvector.end() );
  12. }
  13.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/array:40,
                 from prog.cpp:1:
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/c++0x_warning.h:36:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
prog.cpp: In function ‘int main()’:
prog.cpp:8: error: ‘srand’ was not declared in this scope
prog.cpp:11: error: ‘random_shuffle’ was not declared in this scope
stdout
Standard output is empty