I have a problem with filling my array correctly and using the contents of the array...
my text file: 1 2 3 4 5 6 7 8
int col = 2;
int row = 4;
double matrix[row][col];
ifstream f("Data.txt");
f >> row >> col;
for (int j = 0; j < row; j++){
for (int i = 0; i < col; i++){
f >> matrix[j] ;
}
}
f.close();
afterwards I want to use the contents on my GUI, for example with:
(*WxEdit1) << matrix [1][1];
But the matrix is everywhere 0.00.
What am I doing wrong?
read file and fill 2D array Topic is solved
Re: read file and fill 2D array
haha, just remove "f >> row >> col;" and everything is fine. I was confused..