Hi, in the below given program the answer is
1. agpur
2. jabalpur
3. jabalpur
I understood the processing for the first two printf statements but for the last printf statement I could not understand the processing. Could anyone please explain.
Thanks in advance :)
#include<stdio.h>
#include<conio.h>
void main()
{
struct s1
{
char*z;
int i;
struct s1 *p;
};
static struct s1 a[]={{"Nagpur",1,a+1},{"Raipur",2,a+2},{"Jabalpur",3,a}};
struct s1 *ptr=a;
clrscr();
printf("%s \n",++(ptr->z));
printf("%s \n", a[(++ptr)->i].z);
printf("%s\n",a[--(ptr->p->i)].z);
getch();
}