#include "stdio.h"
void test6(void)
{
typedef struct node
{
int x;
struct node *p;
} Node;
Node link1,link2,link3,*temp;
link1.p = & link2;
link2.p = & link3;
link3.p = & link1;
link1.x = 12;
link2.x = 22;
link3.x = 32;
temp=&link1;
printf("temp->x = %d\n",temp->x);
temp=temp->p;
printf("temp->x = %d\n",temp->x);
temp=temp->p;
printf("temp->x = %d\n",temp->x);
printf("Hello world !\n");
}
int main(void)
{
test6();
return 0;
}
|