I created an array and put the value into array as follow
int *ptr_int;
int list_int[10];
int i;
for (i=0; i<10; i++)
list_int[i] = i + 1;
and I assign a value into list_int array like this
list_int[17] = 18;
When I tried to get the count of array as follow
int size = sizeof(list_int ) / sizeof( int );
printf( "The size of int is %d.\n", size);
the result is only 10.
How could I get the array room count?
malloc()/calloc(),realloc()andfree()in particular. Do some tests leaning how to use them and if getting stuck using them come back here to Stackoverflow presenting your findings and issues posing another question and we'll try to help you.