📄 718a.cpp
字号:
//718a.CPP demo ofstream
#include <iostream.h>
#include <fstream.h>
main(void)
{
char *p="Hi! This is 718a.CPP\n";
ofstream out("718a.bak");
if(!out)
{ cout << "Cannot open file"; return 1; }
out.put(*p);
cout<<p<<"End of 718a.CPP\n";
while(*p){ out.put(*p++); }
out.close( );
return 0;
}
/*Output on screen while runing:
Hi! This is 718a.CPP
End of 718a.CPP
*/
/*and the file 718a.bak's content: ???
HHi! This is 718a.CPP
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -