【发布时间】:2013-04-26 04:09:26
【问题描述】:
这是我程序的摘录——我想显示存储在输出窗口中的文本。文本根据需要存储在文件中。但是,阅读时,屏幕上不显示内容。应该做出什么改变?
ofstream out("Welcome");
out<<" WELCOME TO MAIN BANK ATM SIMULATOR "<<endl;
out<<"Select operation mode:\n1. Administrator Mode\n2. User Mode\n3. Exit"<<endl;
out.close();
ifstream in("Welcome");
char asd[100];
in>>asd;
cout<<asd<<endl;
in.close();
getch();
return 0;
【问题讨论】:
-
您的大部分输出将发送到一个名为
Welcome的文件。然后应该从该文件中读取“WELCOME”并显示在屏幕上,但不会读取或显示其余部分。