3 ms·
I've just realised that you might think that z_terminated actually "contains" the string, and hence "in-place" would mean modifying z_terminated. But z_termina
by RiderOfGiraffes 16y ago
I've just realised that you might think that z_terminated actually "contains" the string, and hence "in-place" would mean modifying z_terminated.
But z_terminated is a pointer to a lump of memory that contains bytes. In that context "in-place" means that you move things around in the lump of memory you are given (the one pointed to by z_terminated) rather than allocating some more memory and using that.
If I'm right, your misconception is by no means unique, but it's a dangerous one that shows that you don't understand what's going on in C with regards pointers, memory and strings.
If I'm wrong then I apologise.