LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamically allocate 2d array

I'm trying to dinamically allocate a 2 dimensional array like this:

double **array;

//create array
array = (double **) malloc ( LEN1 );
for (i = 0; i < 8; ++i )
array[i] = (double *) malloc ( 10 );


//fill the array
for (i = 0; i < 8; ++i) {
for (j = 0; j < 10; j++) {
array[i][j] = someValue;
}

The problem is that I don't get the expected size, always creates a smaller array so index goes out of bounds while filling it.
What's wrong in this code?

Thank you.
Image Hosted by ImageShack.us
0 Kudos
Message 1 of 2
(2,507 Views)
Please post your questions on only one message board.
Please see the response to this question in the LabWindows/CVI board here:
http://forums.ni.com/ni/board/message?board.id=180&message.id=13136
0 Kudos
Message 2 of 2
(2,499 Views)