Hello I'm trying to test out a random number generator to see how the distribution is and I want to write the values I get from the number generator to a file. Can someone show me in a simple code how to do that, or a good website where I can see how to do it. Thanks!
I looked at the tutorial and I modified the code a bit but I can't get it to print out my random numbers. I know what I'm doing is probably sill, but I can't figure how to print out what I want. Here's the code:
using namespace std;
srand( (unsigned)time( NULL ) );
file.open("up.txt"); //open a file
for( i = 0; i < 10;i++ )
file<<"%d file\n",rand(); //write to it
file.close(); //close it