- 1
Please explain this answer
3 odpowiedzi
+ 4
s = starting address of the string stored in it. Let's say it is x
p = s (initially) = x
while(*p++); means p will run through the entire length of the string until it reaches end of string '\0'
therefore, now p = starting address + length of string + 1 (due to '\0')
p = x + 8 + 1
p = x + 9
therefore, p - s = x + 9 - x = 9
0
Hey Infinity thanks for this good explanation !
0
you're welcome