急需!!!!
具体写一下吧。谢了,fopen我还没学,不是很清楚。
ofstream outfile(filename,ios::out|ios::ate); if(!outfile){ exit(1);} outfileItem_nameItem_codequantitycolour<<endl<<endl; outfile.close();
这样的话,你再次用ofstream 以打开的方式打开这个文件,这个文件的内容就被清除了