The while( *pdst++ = *psrc++ ) line is of a most interest here.
What happens here?
Pointers' postfix increment that returns their copies is performed first. Dereference and assignment of a source character value to a receiver character happens after. And, finally, (loop ending condition!) the result - character value - is being checked for 0 (null-terminator at the end of a string).
To sum up: given code is a tricky version of a string copy approach.
Login in to like
Login in to comment