亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

和答案一樣通過不了

/474/9251/BqNL/index.cpp: In function 'void doSomething(Movable*)':
/474/9251/BqNL/index.cpp:62:16: error: must #includebefore using typeid
? ? if(typeid(*obj)==typeid(Bus))
? ? ? ? ? ? ? ?^
/474/9251/BqNL/index.cpp:62:32: error: must #includebefore using typeid
? ? if(typeid(*obj)==typeid(Bus))
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^
/474/9251/BqNL/index.cpp:68:16: error: must #includebefore using typeid
? ? if(typeid(*obj) == typeid(Tank))
? ? ? ? ? ? ? ?^
/474/9251/BqNL/index.cpp:68:35: error: must #includebefore using typeid
? ? if(typeid(*obj) == typeid(Tank))

正在回答

2 回答

頭文件的類容有所不同吧,VS可能自帶了對typeid的定義

0 回復 有任何疑惑可以回復我~

要加上

#include<typeinfo>

2 回復 有任何疑惑可以回復我~
#1

Foxyy

哥們,我想問問哈,我用VS編譯的時候沒有加#include<typeinfo>,怎么也通過了,如果不看你的回復我肯定還蒙在鼓里的
2016-06-07 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
C++遠征之多態篇
  • 參與學習       66224    人
  • 解答問題       334    個

本教程將帶領大家體會面向對象三大特性中的多態特性

進入課程

和答案一樣通過不了

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號