c++: optimize writing to .csv file -


i have huge array of positive (>=0) integers , in program need print file several times, formatting matrix in .csv

i wondering efficient way this, since program spending of time writing out...

my way is:

ofstream fout(to_string(k)+".csv) if(fout){    for(unsigned int i; i<numrows; ++i){       for(unsigned int j; j<numcol; ++j          fout<<array[i*numcol+j]<<",";       fout<<array[i*numcol+numcol-1]<<"\n";       };   }else{.....}; 


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -