#ifndef _ILIST_H
#define _ILIST_H
// 定义链表中的节点结构
typedef struct node{
void *data;
struct node *next;
}Node;
// 定义链表结构
typedef struct list{
struct list *_this;
Node *head;
int size;
void (*insert)(void *node);// 函数指针
void (*drop)(void *node);
void (*clear)();
int (*getSize)();
void* (*get)(int index);
void (*print)();
}List;
void insert(void *node);
void drop(void *node);
void clear();
int getSize();
void* get(int index);
void print();
#endif /* _ILIST_H */
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter