- 博客(5)
- 收藏
- 关注
原创 求问路过一个动态链表的输出问题
想做一个成绩查询,利用结构体和链表知识,但是在输出打印成绩时,第二个结点无法打出来,只能输出头节点和尾节点,存在逻辑错误,请求大神帮忙 以下时代码 #include<stdio.h> 2 #include<stdlib.h> 3 4 struct student 5 { 6 int Chinese; 7 int math; 8 int English; 9 struct student next; 10 }; 11 12
2020-06-08 00:55:31
295
原创 C语言之关于链表插入等号左边右边到底如何确定的问题
引言:可能看到这个标题有些人会感到疑惑,废话不多说,上代码 1.从中间插入 #include<stdio.h> struct Test { int data; struct Test *next; } int printlinkcode(struct Test *head)//定义输出函数 { while(1){ if(head!=NULL){ printf("%d ",head->data); head=head->next //遍历链表,下面都要用到这一步 }else{ brea
2020-05-28 22:06:04
1557
原创 整理的链表几种插入方式一之从前面插入(C语言)
前面我总结了从中间节点插入,这次总结一个从头部来插入 struct Test { int data; struct Test *next; } struct Test *insertFromhead(struct Test *head,int data,struct Test *new) { if(head->data == data){//头节点 new->next = head; return new;//直接从链表头插入 } while(head->next!=NULL){//非头节
2020-05-19 12:41:22
4395
原创 整理的链表几种插入方式一之从指定结点插入(C语言)
链表是个好东西,就是逻辑有点绕,今天总结了关于链表的几种插入方法。先看代码 1.从中间插入 #include<stdio.h> struct Test { int data; struct Test *next; } int printlinkcode(struct Test *head)//定义输出函数 { while(1){ if(head!=NULL){ printf("%d ",head->data); head=head->next //遍历链表,下面都要用到...
2020-05-19 11:18:52
1070
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅