The postfix ++
operator increments the value of a variable after the statement it’s in has been executed. According to C’s precedence rules, the expression will be evaluated something like this:
while (*(dst++) = *(src++));
Which will basically:
- Set the character
dst
points to to the charactersrc
points to. - Increment both
dst
andsrc
- If the character was
'\0'
, end the loop. - Otherwise, repeat.
3
solved how ‘while (*dst++ = *src++) ;’ be executed? [duplicate]