writing a matrix into a txt file with ; after each row C++? -


i have matrix " powermatrix" of size 24 * 24 need know how can write matrix text file ; after each row? how can this? have code till it's not working don't know why , yet can't separate using ; after each row?

std::ofstream output("power vector.txt");  (k=1; k<powermatrix.size(); k++) { (l=1; l<powermatrix.size(); l++) { output << powermatrix[i][j] << " "; // behaves cout - cout stream } output << "\n"; }  

just add ; before newline:

std::ofstream output("power vector.txt");  (k=1; k<powermatrix.size(); k++) {     (l=1; l<powermatrix.size(); l++)     {         output << powermatrix[i][j] << " "; // behaves cout - cout stream     }     output << ";" << endl; }  

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -