Is this possible? i malloc it to hold a string of length 20, but want to initialize it to empty and not just a \0 at the first elements spot...
Is this possible? i malloc it to hold a string of length 20, but want to initialize it to empty and not just a \0 at the first elements spot...
There is no difference between "empty" and "just a \0 at the first elements spot".
Or just run a loop through them and set it yourself.Code:memset( ptr, '\0', len );
Quzah.
Hope is the first step on the road to disappointment.