Hi guys,
I have a vector represent a matrix, and now I'm trying to write it into a .mtx file, could anyone tell me how to do it?
Here is an example matrix: <1,4,5,3,2,1,4,5,6>
Many thanks
Hi guys,
I have a vector represent a matrix, and now I'm trying to write it into a .mtx file, could anyone tell me how to do it?
Here is an example matrix: <1,4,5,3,2,1,4,5,6>
Many thanks
A for loop perhaps?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Code:std::vector<int>::iterator it; for ( it = vec.begin(); it != vec.end(); ++it ) ofstream << (*it);