数据结构单链表问题 10

数据结构单链表问题typedefstructnode{intdata;PNodenext;}PNode,*Linklist这个pNode*p和Linklistp定义的p有... 数据结构单链表问题typedef struct node
{
int data ;
PNode next;
}PNode,*Linklist
这个pNode *p和Linklist p定义的p有什么不同?
展开
 我来答
司马刀剑
高粉答主

2018-09-19 · 每个回答都超有意思的
知道顶级答主
回答量:4.6万
采纳率:93%
帮助的人:7069万
展开全部
代码如下:
#include "stdio.h"
#include <stdlib.h>
typedef struct node { int data; struct node *next; } listnode;
listnode* INITLIST() { listnode *hd=(listnode *)malloc(sizeof(listnode));
hd->next=NULL;
return hd; }
void CREALIST(listnode *hd)
{ int dt;
scanf("%d",&dt);
while(dt!=-1) {
listnode *p=(listnode *)malloc(sizeof(listnode));
p->data=dt;
p->next=hd->next;
hd->next=p;
scanf("%d",&dt);
}
}
void PRINTLIST(listnode *hd) { l
istnode *p=hd->next;
while(p!=NULL) {
printf("%d ",p->data);
p=p->next; } }
void FREELIST(listnode *hd) {
while(hd->next!=NULL)
{
listnode *p=hd->next;
hd->next=p->next;
free(p); } }
void main() { listnode *head=NULL; head=INITLIST(); CREALIST(head); PRINTLIST(head); FREELIST(head); free(head); }
光点科技
2023-08-15 广告
通常情况下,我们会按照结构模型把系统产生的数据分为三种类型:结构化数据、半结构化数据和非结构化数据。结构化数据,即行数据,是存储在数据库里,可以用二维表结构来逻辑表达实现的数据。最常见的就是数字数据和文本数据,它们可以某种标准格式存在于文件... 点击进入详情页
本回答由光点科技提供
MrAllRight
2018-09-19 · TA获得超过2362个赞
知道大有可为答主
回答量:3639
采纳率:50%
帮助的人:2143万
展开全部
说实话,后面跟一个*Linklist很让人混淆。不管你是想定义变量类型还是定义变量,都不建议这么做
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式