#include<stdio.h>
main()
{
int a=10;
printf("\n %d %d",++a,a++);
getch();
}
Observation: The printf statement get executed from the right side. so first the a will be printed as it is and then it gets incrimented and then again incrimented and the a value is printed means second a incrimented twice before it gets printed.
#include<stdio.h>
main()
{
int *p;
printf("sizeof(*p)=%d ,sizeof(p)=%d",sizeof(*p),sizeof(p));
getch();
}
main()
{
int a=10;
printf("\n %d %d",++a,a++);
getch();
}
Observation: The printf statement get executed from the right side. so first the a will be printed as it is and then it gets incrimented and then again incrimented and the a value is printed means second a incrimented twice before it gets printed.
#include<stdio.h>
main()
{
int *p;
printf("sizeof(*p)=%d ,sizeof(p)=%d",sizeof(*p),sizeof(p));
getch();
}
No comments:
Post a Comment