I am trying to understand the code piece below But I could not solve it,(especially )
void fun(char **p)
{
char *t;
t = (p+= sizeof(int))[-1]; //especially this line,why there is "-1" in here?
printf("%s\n", t);
}
thanks for your time.
The
t = (p+= sizeof(int))[-1];
can be rewritten as
p += sizeof(int); /* The logic of this doesn't make a whole lot of sense to me */
t = *(p - 1);
Hope this clears things up.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.