C++循环保存多个文件到指定位置

        char achFileName[256];
        sprintf(achFileName, "../save/shishi/f_%d%c", i + 1, 0);
        ofstream outfile(achFileName)for(int i = 0; i <XXXXXX; i++) {
            double x[] = {0, 0, 0};
            ........
            outfile  <<  x[0] << " " << x[1] << " " << x[2]  << endl;
       }
        outfile << endl;
        outfile .close();

大概流程就是这样的

发布了37 篇原创文章 · 获赞 5 · 访问量 2171

猜你喜欢

转载自blog.csdn.net/weixin_44723106/article/details/103530990