Right i've allocated space in memory for.
This array then gets thrown into a list and another word put into it, then into the list etc. What i'm trying to do, once the word is in the array is to realloc the array down to the right size. I am currently doingCode:temp = calloc( 30, sizeof( char ) ) ;
I want to use the integer i to resize as it knows the size as i read the characters in one by one. But it doesn't like it. Does it have to be a number value? Also i have read somewhere that realloc doesn't remove anything just removes whatever is not used. So could i just put a value of 1 in there instead??Code:temp = realloc( temp, i*sizeof( char ) ) ;
Cheers.