[問題] struct裡的問題

看板C_and_CPP作者 (malowda)時間14年前 (2010/03/23 11:05), 編輯推噓0(002)
留言2則, 1人參與, 最新討論串1/1
( *[1m *[m 為色碼,可以按 Ctrl+V 預覽會顯示的顏色 ) ( 未必需要依照此格式,文章條理清楚即可 ) 遇到的問題: (題意請描述清楚) struct THREADPARAM { unsigned int m_BBeginSegAddress[4]; unsigned int m_BEndSegAddress[4]; CMyPortScannerDlg *const dlg; THREADPARAM(CMyPortScannerDlg *d):dlg(d) { dlg->SetWindowText("Win!"); } }; struct THREADPARAM裡出現 THREADPARAM(CMyPortScannerDlg *d):dlg(d) { dlg->SetWindowText("Win!"); } 是什麼意思呢 請版上的大大幫忙謝謝 開發平台: (例: VC++ or gcc/g++ or Dev-C++, Windows or Linux) 有問題的code: (請善用置底文標色功能) 補充說明: -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.26.24.160

03/23 11:07, , 1F
constructor,你可以把它看做 class。在 c++ 裡
03/23 11:07, 1F

03/23 11:07, , 2F
class 和 struct 只差在預設的 visibility
03/23 11:07, 2F
文章代碼(AID): #1Bg2_brb (C_and_CPP)