Problems with saved matrices

Hello. I have this function:

void GemFil2(double A4[nMax][nMax],double A8[nMax][nMax])
{
int j,i;
ofstream UdFil;

UdFil.open("OrtMat48.txt");
UdFil<<4<<"\n";
for(i=0;i<4;i=i+1)
{
for(j=0;j<4;j=j+1)
{
UdFil<<A4[i][j]<<" ";
}
UdFil<<"\n";
}
UdFil<<8<<"\n";
for(i=0;i<8;i=i+1)
{
for(j=0;j<8;j=j+1)
{
UdFil<<A8[i][j]<<" ";
}
UdFil<<"\n";
}
UdFil.close();
}



I have saved other matrices before and retrieved them with great success, but now that I have to save two in the same function I get different values in my text than what I originally wrote.

E.g: When I enter my 4x4 matrix I get all zeroes in my .txt and the same with my 8x8 matrix.

What is going wrong here?

Thanks
Topic archived. No new replies allowed.