what difference between while(*p){p++;} ,while (*++p){;} and while(*p++){;}?

前端 未结 4 1794
日久生厌
日久生厌 2021-01-07 11:45

It\'s about strcat function.

while (*p)
    p++;

and

while (*++p)
    ;

both works, but

4条回答
  •  一整个雨季
    2021-01-07 12:20

    *++p means increment this variable, then use it
    *p++ means use the variable, then increment it

提交回复
热议问题