⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delete.c

📁 一个有关linux下面Makefile与链表结合的演示程序
💻 C
字号:
#include<stdio.h>
#include"def.h"

struct student * del(struct student * head, long num)
{
	struct student *p1,*p2;
	if(head==NULL)
		{printf("\nList null!\n");goto end;}
	p1=head;
	while((num!=p1->num)&&(p1->next!=NULL))
		{
			p2=p1;
			p1=p1->next;
		}
	if(num==p1->num)
		{
			if(p1==head)
				head=p1->next;
			else
				p2->next=p1->next;
			printf("\nthe value %ld was deleted!\n",num);
			n=n-1;
		}
	else
		printf("\nThe value %ld is not found!\n",num);
	end:
	return (head);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -