how we can use dynamically allocated two-D array in tokenization
1
Expert's answer
2012-11-12T06:13:28-0500
1)Initialize at the beginning: double **queryPoint = 0; int qp_count = 0; 2)For every line call: // call realloc to make the space for points larger by one element queryPoint = realloc(queryPoint, sizeof(double*)*(qp_count+1)); // allocate space for the new point queryPoint[qp_count] = malloc(sizeof(double)*2); // increase the point count qp_count++;
Comments
Leave a comment