#include <windows.h>
#include <iostream.h>
#include <fstream.h>
void main()
{
ifstream ifile;
char str1[256] ;
ifile.open("sfile.txt");
while(ifile)
{
ifile.getline(str1,256);
MessageBox(0,str1,"内容",0);
}
return;
}
本文介绍如何使用C++编程语言通过ifstream类读取指定文件,并利用MessageBox函数显示文件内容。
1066

被折叠的 条评论
为什么被折叠?



