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;?????//這里把一個結(jié)構(gòu)體?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?????????????????????*/
總結(jié)
以上是生活随笔為你收集整理的c语言中listnode是什么意思,怎么理解typedef Node * List的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: matlab工作区保留或者清除部分变量
- 下一篇: Mouse Without Border