看板 Programming 關於我們 聯絡資訊
class A { public: A( int c ){}; ~A(){}; }; class B { public: B(){}; ~B(){}; A a( 5 ); // 這樣不行嗎? }; 會出現下列的錯誤訊息: error: expected identifier before numeric constant error: expected `,' or `...' before numeric constant error: ISO C++ forbids declaration of `parameter' with no type 看來是把它當成一個function definition了, 不知道正確的寫法是怎樣呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 211.74.71.41