この厄介なエラーがあります。
class::method への未定義の参照を取得し続けます
これは私がやりたいコードです
student::student(){
conscience* c;
unsigned short choice = rand() % 4;
if (choice == 0){
c = new betray();
}
if (choice == 1){
c = new silent();
}
if (choice == 2){
c = new confused();
}
if (choice == 3){
c = new experienced();
}
しかし、エラーが発生し続けます。
この回避策はうまく機能しますが、メイン クラスのコンストラクターではなく、引数によって渡されます。
student::student(conscience* c){
m_Conscience = c;
}
前もって感謝します。
編集:正確なエラー:「betray::betray()」への未定義の参照