Firstly I want to apologize If I ask something silly, but I have just started learning C++, and I really don't know much.
As a practice I have a challenge of writing a matrix in a file, and then reading the information (numbers) from it, and in the end to be able to do some calculations, for example to multiply the positive members of that matrix.
So far I have only managed to write a matrix in a file by using this code:
const int m=4, n=5;
ofstream Write("c:/matrix/matrix.txt", ios::out);
Write << setw(3)
<< A[j] ;
Write << "n";
Now the next thing i want to do, is to make some calculations with specific members of the matrix, say multiply the negative members or something like this.
I'm trying to use the "ifstream Read("c:/matrix/matrix.txt", ios::in)" to open the file for reading, but I can't figure it out how to achieve the above goal.
Can someone show me an example of how I might achieve this?
Thanks in advance for any kind of help.