Here as p = s. p is pointing to knowledge. and when we do ++*p then p would point to " nowledge ". so and then when we do *p++ then here the whole pointer p would move to second element of s i.e. "is". but as it is post increment the ans remains same " knowledge" then when we do ++*p so it moves to ' s ' of is. so final output would be nowledge, nowledge and s.
Here as p = s.
ReplyDeletep is pointing to knowledge.
and when we do ++*p then p would point to
" nowledge ".
so and then when we do *p++ then here the whole pointer p would move to second element of s i.e. "is".
but as it is post increment the ans remains same
" knowledge"
then when we do ++*p so it moves to ' s ' of is.
so final output would be
nowledge, nowledge and s.
prashant is write..
ReplyDeletewill you please explain how ++*p points to "nowledge"?
ReplyDeleteThis comment has been removed by the author.
ReplyDelete