Tuesday, August 11, 2009

str[-1]

#include
#include

int main () {

char s[] = "0123456789\0";

char *p;

p = &s[5];

printf("p=%c, \n", *p);
printf("p[-1]=%c, \n", p[-1]);// points previous one: 4

return 0;
}

No comments:

Post a Comment