c - How does this loop end? -
code example this:
#include<stdio.h> void main() { char *s={"abcd"}; { printf("%d\n",++s); } while(*s); }
where pointer s point when loop ends?how work?
in c, 0 equivalent false
. when *s
points terminator character in string (a zero), loop stops.
Comments
Post a Comment