c语言中listnode是什么意思,怎么理解typedef Node * List
如何理解typedef Node * List
各位达人,近日看C Primer Plus中的一个单链表的头文件,其中有一个typedef看不大明白。具体情况如下:
/* list.h -- header file for a simple list type */
#ifndef LIST_H_
#define LIST_H_
#include /* C99 feature */
/* program-specific declarations */
#define TSIZE 45 /* size of array to hold title */
struct film
{
char title[TSIZE];
int rating;
};
/* general type definitions */
typedef struct film Item;
typedef struct node
{
Item item;
struct node * next;
} Node;
typedef Node * List; //这里把一个结构体 Node 定义成一个指针 * List,不是很明白,请具体讲解一下,谢谢!
/* function prototypes */
/* operation: initialize a list */
/* preconditions: plist points to a list */
/* postconditions: the list is initialized to empty */
void InitializeList(List * plist);
/* operation: determine if list is empty */
/* plist points to an initialized list */
/* postconditions: function returns True if list is empty */
/* and returns False otherwise */
bool ListIsEmpty(const List *plist);
/* operation: determine if list is full */
/* plist points to an initialized list */
/* postconditions: function returns True if list is full */
/* and returns False otherwise */
bool ListIsFull(const List *plist);
/* operation: determine number of items in list */
/* plist points to an initialized list */
/* postconditions: function returns number of items in list */
unsigned int ListItemCount(const List *plist);
/* operation: add item to end of list */
/* preconditions: item is an item to be added to list */
/* plist points to an initialized list */
/* postconditions: if possible, function adds item to end */
/* of list and returns True; otherwise the */
/* function returns False */
总结
以上是生活随笔为你收集整理的c语言中listnode是什么意思,怎么理解typedef Node * List的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: matlab工作区保留或者清除部分变量
- 下一篇: Mouse Without Border