作者sleepy5300 (哈波)
看板C_and_CPP
標題[問題] Calling non-member function
時間Sat Aug 31 00:31:02 2019
小弟C++新手,想請問版上各位
當我在定義一個member function時需要用到non-member function
且這個non-member function定義在其他的source file
請問有相關的範例code或資料可以給小弟參考嗎?
感激萬分!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.194.128.107 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1567182664.A.C45.html
→ Lipraxde: 你平常用 printf、std::cout 的時候他們有在你原始碼裡 08/31 01:37
→ Lipraxde: 面嗎? 08/31 01:37
→ EricTCartman: 不用知道定義 有宣告且連結到東西就好 09/02 20:42
推 jass970991: 你是不是忘記include東西 09/03 23:51
推 Gway: include <你需要的member fun所屬的檔案> 09/06 17:12
→ Lipraxde: 通常都是 include 標頭檔,在標頭檔裡放宣告 09/07 02:47
推 ando5566: extern過來用也行 09/07 15:27