在下面的程序中,
int main()
{
char a[] = "azmruf";
char *ptr = a;
ptr += 5;
//Now ptr points at 'f'
printf("%c", --*ptr--); //e got printed. Bcos of post increment now ptr in u.
printf("%c", *ptr); // so 'u' got printed now.
// Next --*--ptr becomes --*(--ptr),
// ptr is moved to r, then --r i.e q is printed, but pointer should
// be in 'r'
printf("%c", --*--ptr);
//Im here getting 'q' only instead of 'r'. There is no 'q' in my string.(??!!!)
printf("%c", *ptr);
return 0;
}
我如何在最后一个 printf() 中得到“q”?