I have just started learning c++, so my question may seen extremely downscaled.
Can anyone please explain srand function properly?
ALSO, is there a srand replacement (except for rand) which is more simpler and doesn't using printf func?
I am currently using this code:
#include <stdio.h> /* printf, NULL */
#include <stdlib.h> /* srand, rand */
#include <time.h> /* time */
#include <iostream.h>
#include <conio.h>
#include <string>
#include <math>
#include <ctype>
int main ()
{
float a;
start:
a=srand (time(NULL));
cout<<a;
getch();
goto start;
}
which provides me with the following error:
1. Srand not an allowed function.
Any help would be appreciated. :)