Hi.
I'm a newbie on C++ and I have a problem with my program.
My program randoms a bunch of names and the puts the out on the screen and I want to save the text in a file (the same text as the screen shows).
Here's the basic code:
Now I want to save the random names that are put out on the screen.Code:char c[4][6] = {"Tony,"James","Johnny","Lars"}; srand((unsigned)time(NULL)); for (i=0;i<4;i++){ cout<<c[rand() % 4]<<"\n"; } // save code?
Please help.




Reply With Quote