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!
Code:#include "ultimate.h" using namespace std; string variable; int main() { HANDLE hStdout; hStdout = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hStdout, BACKGROUND_BLUE); cout<<" ---[The Civic Wordedit]--- _ X"<<endl; textcolor(LIGHTGRAY); char variable; 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 fout.close(); system("pause"); return 0; }



LinkBack URL
About LinkBacks




Have a nice day.