I am very new in programming and C++. My first task to learn is creating 10 random number generator and have 10 files. Write this 10 number (different numbers in every file) into 10 files. Later on, open the file and from the console read this. Until now, I have figured out for one file but I can't make for ten files. Here is my code;
#include<iostream>
#include<fstream>
#include<stdlib.h>
#include<time.h>
using namespace std;
int main()
{
ofstream outputFile;
outputFile.open("0.dat");
int i, n;
time_t t;
n = 10;
/* Intializes random number generator */
srand((unsigned) time(&t));
/* Print 10 random numbers from 0 to 1023 */
for( i = 0 ; i < n ; i++ )
{
outputFile << rand() % 1023 << endl;