I want to get a value from /dev/urandom and use the value, then assign a new value from /dev/urandom to the same variable and use that new value. This will be done in an if inside a while-loop that will keep repeting
I have tried using:
Code:
fp = fopen("/dev/random", "r");
fclose(fp);
and freopen() as well, but neither work
I end up with something like this:
Code:
fp = fopen("/dev/random", "r");
value = (int)fp;
printf("%d", value); //if this prints 25
fclose(fp);
fp = fopen("/dev/random", "r");
value = (int)fp;
printf("%d", value); //then this prints 25
fclose(fp);
I want the second value to be completly different, and also random