[Solved] how ‘while (*dst++ = *src++) ;’ be executed? [duplicate]


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:

  1. Set the character dst points to to the character src points to.
  2. Increment both dst and src
  3. If the character was '\0', end the loop.
  4. Otherwise, repeat.

3

solved how ‘while (*dst++ = *src++) ;’ be executed? [duplicate]