易截截图软件、单文件、免安装、纯绿色、仅160KB

自己用C写的一个链表,老是有错,高手请进!

自己用C语言在VC6.0编译器中写的一个链表程序。三个文件如下:
LList.h:链表的头文件。
C/C++ code:

//用C语言定义的包含int元素的单链表,实现了增删改查功能。
#include <stdio.h>
#ifndef LLIST_H
#define LLIST_H


#ifdef __cplusplus
extern "C" {
#endif
enum bool
{
false,
true
};
typedef struct Node
{
int element;
struct Node *next;
}Node;

typedef struct
{
struct Node *head;
struct Node *tail;
int count;
}LList;
/*
添加一个节点到链表中,成功返回true,失败返回false*/
enum bool add(LList *listPtr, int num);

/*
删除一个含有特定值的接点重链表中*/
enum bool del(LList *listPtr, int num);

/*
修改含有一个特定的植的节点*/
enum bool modify(LList *listPtr,int oldNum,int newNum);

/*
查找一个含有特定值的接点,找到并返回接点的地址*/
Node* find(LList *listPtr,int num);

/*
初始化一个链表*/
enum bool initial(LList *listPtr);
/*
打印链表中的所有元素*/
void printList(LList *listPtr);

#ifdef __cplusplus
}
#endif

#endif

LList.c文件,链表的.c文件:
C/C++ code:

#include "LList.h"
#include <stdio.h>
#include <stdlib.h>

enum bool


相关问答:

c基础

#include <string.h>
#include <stdio.h>

void main()
{
int i;
char buf[]="abcde";
strncpy(buf,"abc",3);
for(i=0;i <5;i++)
printf(&q ......

关于the c program 的一道题!

编写程序detab, 将输入中的制表符替换成适当数目的空格,使空格充满到下一个制表符终止的地方。假设制表符终止位的位置是固定的,比如每隔n列就会出现一个制表符终止位。
------------------- ......

管道中输入Ctrl+C的问题求教

我在程序中用CreatePipe创建了一个管道,用它和命令行cmd.exe来关联。

现在我WriteFile来向管道写入 ping 192.168.0.1 -t 来启动ping测试,请问我如何停止这个ping? 我想向管道内写

Ctrl+C来实现,但 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号