日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

c语言中listnode是什么意思,怎么理解typedef Node * List

發布時間:2025/3/15 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。