/*
链式物理结构演示
*/
#include <stdio.h>
typedef struct node {
int num;
struct node *p_next;
} node;
int main() {
//int num = 1, num1 = 2, num2 = 3;
node node1 = {1, NULL}, node2 = {2, NULL}, node3 = {3, NULL}, *p_node = NULL;
/*int *p_num = NULL;
p_num = #
printf("%d ", *p_num);
p_num = &num1;
printf("%d ", *p_num);
p_num = &num2;
printf("%d ", *p_num);
printf("\n");*/
node1.p_next = &node2;
node2.p_next = &node3;
for (p_node = &node1;p_node != NULL;p_node = p_node->p_next) {
printf("%d ", p_node->num);
}
printf("\n");
return 0;
}
链式物理结构演示
*/
#include <stdio.h>
typedef struct node {
int num;
struct node *p_next;
} node;
int main() {
//int num = 1, num1 = 2, num2 = 3;
node node1 = {1, NULL}, node2 = {2, NULL}, node3 = {3, NULL}, *p_node = NULL;
/*int *p_num = NULL;
p_num = #
printf("%d ", *p_num);
p_num = &num1;
printf("%d ", *p_num);
p_num = &num2;
printf("%d ", *p_num);
printf("\n");*/
node1.p_next = &node2;
node2.p_next = &node3;
for (p_node = &node1;p_node != NULL;p_node = p_node->p_next) {
printf("%d ", p_node->num);
}
printf("\n");
return 0;
}