Guest_imported
New member
- Jan 1, 1970
- 0
Hi,
I´d like to dinamicaly create a matrix to implement a linear sistem.
I tried first:
float **matrix;
matrix = new float[10][10];
It didn´t work. Then I tried:
float **matrix;
*matrix = new float[10];
for(int i=0; i<10; ++i)
matrix = new float[10];
It compiled, but when I try matrix[0][0], for example, the program chashes saying it has violated the memory access. Can anyone helpme implement this?
Thanx,
LAC.
I´d like to dinamicaly create a matrix to implement a linear sistem.
I tried first:
float **matrix;
matrix = new float[10][10];
It didn´t work. Then I tried:
float **matrix;
*matrix = new float[10];
for(int i=0; i<10; ++i)
matrix = new float[10];
It compiled, but when I try matrix[0][0], for example, the program chashes saying it has violated the memory access. Can anyone helpme implement this?
Thanx,
LAC.