I need help with saving inputted text to a file.
I'm making a DOS text editor (Yeah i know, dumb idea.) but I cant get the outputted file to display the whole of what the user inputted.
It can't be ultimate.h being included, because it will compile if I
remove the "string variable;" line.
Thanks in advance for any help!
using namespace std;
hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
cout<<" ---[The Civic Wordedit]--- _ X"<<endl;
cin >> variable;
ofstream fout; // this means tha fout acts for ofstream
fout.open("file.txt"); // I have no clue how to have the user pick the file name
fout << "your variable: " << variable << endl; // this couts(or fouts) wutever is in the variable calle "varibakle" into file.txt
What exactly does it output?
Does it only output the first letter? that may be because variable is only a char. and why did you make it a global string? Maybe i am still too much of a n00b, but, that doesn't look right to me.