12345678910111213141516
ofstream writefile; writefile.open("example1.txt"); if (writefile.is_open()) { for(j=0; j<N; j++) { writefile<<arrayQ[j][M-1]; writefile<<" "; } for(j=0; j<N; j++) { writefile<<arrayP[j][M-1]; writefile<<" "; } writefile.close(); }
std::ofstream ofs ("test.txt", std::ofstream::out | std::ofstream::app);