/*在开始之前最好把基本链表的组成基本原理理解清楚*/
#define LEN sizeof(struct node)
//链表节点结构体
typedef struct node
{
int num;
struct node *next;
}Node;
Node *add_node()
{
int temp_num;
Node *pnew = NULL;
pnew = (Node *)malloc(LEN);
printf("please input num:");
scanf("%d",&temp_num);
while(getchar() != '\n');
pnew -> num = temp_num;
pnew ->next = NULL;
return pnew;
}
bool yes_or_no(const char *str)
{
char sel;
while(1)
{
printf("%s",str);
scanf("%c",&sel);
switch(sel)
{
case 'y':
case 'Y':
return true;
case
链表的增、删、改、查、显示(C 语言实现)
最新推荐文章于 2022-01-06 22:30:00 发布