I am looking for a way to get the length of an array for the pointer address. An example:
int *a = (int*)malloc(sizeof(int)*2);// will be an array.
*(a+0) = 1; // values of the array
*(a+1) = 2;
Is there a way to detect how much memory is allocated by this pointer? We suggest that there are no empty elements in this array. If I know how much memory is allocated, I should be able to get the size of an array (deviding by sizeof(int));