12.3-PointersOnC-20220331
单链表
按照教材的二级指针法
#define _CRT_SECURE_NO_WARNINGS 1
#include
#include
#include
#define LENWORD 11
typedef struct node{
struct node *link;
char value[LENWORD];
}Node;
char *my_fgets(char *p,int n);
int ClearList(Node **p);
int AddList(Node **p);
int ShowList(Node **p);
int main(){
Node *root=NULL;
ClearList(&root);
for(fputs("Input the word:->",stdout);AddList(&root)==1;fputs("Input the word:->",stdout));
ShowList(&root);
ClearList(&root);
共有 0 条评论