Hello there my second topic
I need to write a function that writes 10 random numbers into a file.
I came up to this point:
#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
int main(){
ofstream outfile("C:\\Random"); //Random as in you can put any file you want
for(int i = 0; i != 10; ++i){
outfile<< rand() << endl;
outfile.close();
return(0);
}
}
This is half wrong i think
I need help
thanx for reading