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
This is a discussion on mtx file within the C++ Programming forums, part of the General Programming Boards category; Hi guys, I have a vector represent a matrix, and now I'm trying to write it into a .mtx file, ...
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.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
Code:std::vector<int>::iterator it; for ( it = vec.begin(); it != vec.end(); ++it ) ofstream << (*it);