#include<stdio.h>
int main()
{
char a[] = { 'A', 'B', 'C', 'D' };
char* ppp = &a[0];
*ppp++;
printf("%c %c ", *++ppp, --*ppp);
return 0;
}
My expected output was C B. But Output is C A
#include<stdio.h>
int main()
{
char a[] = { 'A', 'B', 'C', 'D' };
char* ppp = &a[0];
*ppp++;
printf("%c %c ", *++ppp, --*ppp);
return 0;
}
My expected output was C B. But Output is C A
Use parenthesis in those cases so we understand what you want to do. Do you increase the pointer ?
ppp++;
Do you increase the value inside ?
(*ppp)++;