struct phone_node{
char name[20];
char phone_num[20];
struct phone_node * pre;
struct phone_node * next;
};
#include <stdio.h>
void display_from_last(struct phone_node * poi)
{
while (poi)
{
printf("%s 's telephone num is %s.\n", poi->name, poi->phone_num);
poi = poi->pre;
}
}
int main()
{
struct phone_node t1 = { "jjw", "123456" };
struct phone_node t2 = { "jwj", "234567" };
struct phone_node t3 = { "jjw", "345678" };
struct phone_node *first = &t1;
struct phone_node *last = &t3;
t1.next = &t2;
t2.next = &t3;
t3.next = NULL;
t1.pre = NULL;
t2.pre = &t1;
t3.pre = &t2;
display_from_last(last);
}
标准c语言基础教程 练习13.1 编程练习 第5题 答案
猜你喜欢
转载自blog.csdn.net/wx_assa/article/details/103491648
今日推荐
周排行