[問題] 請教 typedef 的用法

看板C_and_CPP (C/C++)作者 (史塔克)時間11年前 (2014/10/07 15:18), 11年前編輯推噓1(105)
留言6則, 3人參與, 最新討論串1/1
開發平台(Platform): GCC 額外使用到的函數庫(Library Used): Arduino.h for x86 (made by Intel) 問題(Question): 我在 Library 內看到 typedef void SmartThingsCallout_t(String message); 想請教當我使用 SmartThingsCallout_t *_calloutFunction; 所代表的含意是甚麼?或是未使用 typedef 的寫法可能是甚麼? 我知道此部分的 Code 的用途是做 Function 呼叫 (在 Library 所定義的物件內做邏輯判斷後,呼叫在 main 定義的 Function ) -- 程式碼(Code):(請善用置底文網頁, 記得排版) Sample code http://codepad.org/zszp2cU3 Library http://codepad.org/FlCicloh -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.30.200 ※ 文章網址: http://www.ptt.cc/bbs/C_and_CPP/M.1412666335.A.BC9.html

10/07 15:20, , 1F
不就是把"void (String message)"這個 function type
10/07 15:20, 1F

10/07 15:21, , 2F
取名叫那個名字嗎?還有 sample code 不要放在需要下載
10/07 15:21, 2F

10/07 15:21, , 3F
的地方,會讓人沒有動力去看 XD
10/07 15:21, 3F
謝謝提醒,那如果不用 typedef 會長甚麼樣子? ※ 編輯: StranGhost (140.112.30.200), 10/07/2014 15:26:16

10/07 15:28, , 4F
就 func ptr, void (*_calloutFunction)(String);
10/07 15:28, 4F

10/07 15:30, , 5F
了解 Thx
10/07 15:30, 5F

10/09 17:01, , 6F
10/09 17:01, 6F
文章代碼(AID): #1KCvFVl9 (C_and_CPP)
文章代碼(AID): #1KCvFVl9 (C_and_CPP)