看板 EE_DSnP 關於我們 聯絡資訊
當我寫 class ModInt { friend ostream& operator << (ostream& os, const ModInt& n); private: int _number; static unsigned _modulus; }; ostream& operator<<(ostream &os, const ModInt &n ) { os<<n._number; return os; } 為何他說n不能access到_number呢? 我明明有宣告friend呀? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.210.43.232
ric2k1:上面的 code compile OK 呀! What's the error message? 01/01 21:55