VC对标准C++支持怎么那么差~~各位帮忙看看这几句文件操作的代码吧!!!
我这段代码:
#include <fstream.h>
int main(int argc, char* argv[])
{
char ch[100];
fstream myfile;
myfile.open("text1.txt",ios::out,filebuf::sh_read);
while(myfile.getline (ch,100))
{
int num = 0;
while(ch[num]!='\0')
{
if(ch[num]!=32)
{
cout<<ch[num];
}
num++;
}
cout<<endl;
}
return 0;
}
为什么没有把文件的内容给读出来?VC6对标准C++的支持也太次了!我的代码在BCB下就工作正常。
还发先,在VC6里,我
#include <fstream>
using namespace std;
后,cout居然都不认识了!!!!真刺激人~~~
各位帮忙看看上面的代码怎么改VC才能认识吧,我是不行了~~