i'll be happy if some one tell me how to use random function in C++.i'm using bloodshed as dev-c++.this is my instant of using rand() function but it does not work.help me!!
srand(time(0));
magic_number=(rand() %3)+1;
i'll be happy if some one tell me how to use random function in C++.i'm using bloodshed as dev-c++.this is my instant of using rand() function but it does not work.help me!!
srand(time(0));
magic_number=(rand() %3)+1;
What's the error message?
What do you mean by "not working"?
"Not compiling"?
"Not giving the proper output"?
"Crashing"?
Have you included the proper headers?
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.