Hi all,
I am having a problem I never had before when deallocating a pointer to char. I am not sure what I am doing wrong because I am using the same standard I have used other times.
I am declaring and allocating the following variable:
and after it use, I free it by:Code:char *problem[10]; //Allocation of the strings of the above lines: for(i=0; i<10; i++) problem[i] = (char *) malloc(32 * sizeof(char *));
but I get the following error:Code:for(i=0; i<10; i++) free(problem[i]);
malloc: *** error for object 0x200000: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Could anyone help me with this?
thank you in advance,
cfd