hi, i am trying to let the user create a file name and past it to the ofstream writer.open()
I am trying to keep asking for char until the user hit the enter key then fileName will be complete even though all the indexes are not filled... and past to the open() function... please help me fix this.. thank you very much.
ofstream writer;
char fileName[20];
cout<<"create a file name please"<<endl;
for(int i=0; i<20; i++)
{
cin>>fileName[i]
if(fileName[i]=='\n';
{
break;
}
}
writer.open(fileName);