Monday, 15 April 2013

c - Segmentation fault in int matrix -


I was using some basic C code that defines the int matrix with the indicator is.

  typingf int ** matrix; Matrix vs. Matrix (intro, int column) {int i, j; Matrix M = (matrix) mauloq (size) * lines * column); For (i = 0; i  

However, they are throwing the m [i] [j] access partition failure. What's wrong here? Too many asterisks?

I was convinced that the indicator is effectively similar to a matrix in an indicator.

Matrix Your allocation of data items assumes that you have given it a single index Are accessing linearly with. If you want to access it with two indices, example , m [1] [1] you must allocate each dimension:

  matrix m = maulok (size (integer *) * line); For (int i = 0; i  

Note that you too.


No comments:

Post a Comment