[問題] compile error
有幾個看不懂的error麻煩強者帮我解答一下...
第一個:
cirMgr.cpp:234: error: ‘class __gnu_cxx::__normal_iterator<CirPiGate**,
std::vector<CirPiGate*, std::allocator<CirPiGate*> > >’ has no member named ‘
getId’
code:
vector<CirPiGate*>::iterator its;
its = _pi.begin();
for(; its< _pi.end(); its++)
if(its.getId() == id)
.
.
.
_pi是一個我用來存CirPiGate*的vector
CirPiGate 是一個計承 CirGate 的 class
以上四行code是在一個switch case裡面的
我檢查過了裡面有getId 這個 member function(在CirGate裡面,非virtual)
第二個:
cirMgr.cpp:303: error: switch quantity not an integer
code:
switch(ilo.c_str()){
.
.
.
ilo是一個只有一個字的string
想把它轉成char來判斷
不知道這樣轉可不可以??
麻煩各位了QQ
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.25.108
推
12/21 21:14, , 1F
12/21 21:14, 1F
推
12/21 21:15, , 2F
12/21 21:15, 2F
推
12/21 21:17, , 3F
12/21 21:17, 3F
推
12/21 21:18, , 4F
12/21 21:18, 4F
→
12/21 21:37, , 5F
12/21 21:37, 5F
討論串 (同標題文章)
完整討論串 (本文為第 6 之 6 篇):