I copied and pasted the same thing from this site reference to CodeBlocks, but there are lots of errors ;
There is a strange error :
error This file requires compiler and library support for the \
ISO C++ 2011 standard. This support is currently experimental, and must be \
enabled with the -std=c++11 or -std=gnu++11 compiler options.
So I think my COdeBlocks is missing something, right?
There are some other errors :
line 8 - random_device was not declared in this scope
line 8 - expected ';' before 'myrd'
line 9 - 'myrd' was not declared in this scope
There is definitely something wrong with my compiler. Because I defined them all ;
You should add -std=c++11 to your compiler arguments. That's exactly what your error says, this function is only available in the c++11 standard.
And if you don't need perfectly unique numbers just use rand()