#include <stdio.h>
struct Person {
char *Name;
int Age;
int Sex;
struct Person *Couple;
};
struct Person P1;
struct Person P2;
int main(void)
{
printf("Hello World!\r\n");
P1.Name = "P1";
P1.Age = 30;
P1.Sex = 1;
P1.Couple = &P2;
P2.Name = "P2";
P2.Age = 30;
P2.Sex = 0;
P2.Couple = &P1;
printf("P1's couple name is %s\r\n", P1.Couple->Name);
printf("P1's couple age is %d\r\n", P1.Couple->Age);
printf("P1's couple sex is %d\r\n", P1.Couple->Sex);
return 0;
}
C语言链表梳理-1-引子
于 2023-08-28 00:05:07 首次发布