精选优质文档-倾情为你奉上c+对txt文件的读取与写入 /* 这是自己写程序时突然用到这方面的技术,在网上搜了一下,特存此以备后用 */ #include #include #include using namespace std; int main() char buffer256; ifstream myfile (c:a.txt); ofstream outfile(c:b.txt); if(!myfile) cout Unable to open myfile; exit(1); / terminate with error if(!outfile) cout Unable to open otfile; exit(1); / terminate with error int a,b; int i=0,j