[問題] 在header file(.h)裡面宣告static funct …

看板C_and_CPP (C/C++)作者 (ai)時間15年前 (2010/12/19 18:54), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
問題(Question): 最近在看list.h這個code 隨便貼一段function static __inline__ void list_add(struct list_head *new, struct list_head *head) { __list_add(new, head, head->next); } 看了許多static的解釋都是關於internal linkage跟external linkge 那宣告成static function,其他file都不能用? 想問一下 1.在Header檔中 宣告static function的用意甚麼? 2.如果不用static,會有甚麼影響? 感謝各位了! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 111.251.173.204

12/19 20:40, , 1F
你可能要先搞清楚 include 在做什麼喔...
12/19 20:40, 1F
文章代碼(AID): #1D3UHea4 (C_and_CPP)
文章代碼(AID): #1D3UHea4 (C_and_CPP)