Hi,
I've been working on this code but recently there's been a problem with a section of my code, this being that there was a stack overload but now, the code just stays in a loop saying that there is an invald arguement. I don't know how to get it to finish and open the file to write to it.
Any help would be appreciated!
This is the code:
void writefile()
{
char writefile[1000000];
char openfile [20];
FILE * pFile;
cout << "\nFile name to open: ";
cin >> openfile;
pFile = fopen (openfile ,"w");
if (pFile == NULL) perror ("Error opening file");
else {
cout<<"Enter text:"<<endl;
cin>>writefile;
fputs(writefile, pFile);
fclose (pFile);
}
}