No worries
No worries
one fish two fish
red fish blue fish
Wow, I am impressed!!!
All this because of something I said...
1 rule of the Samurai Code: if you have nothing to say, don't say anything at all!
> so what about some answers regarding my original question please..... thanks
> but i keep getting a runtime error during the freeing of the elements !
Since there is nothing wrong with the way you allocate and free, there must be something wrong with the way you use the allocated memory.
A common mistake is something like this
Memory is corrupted because you copy one more byte than there is allocated space (therefore running into something else - usually some malloc/free control structure).Code:n = strlen(string); char *p = malloc( n ); // BUG - should be n+1 strcpy( p, string );