这是我的课:
class A
{
public:
int getVal(){return m_val;};
private:
int m_val = 1;
}
class B
{
public:
void print();
private:
std::vector<A*> m_vA;
}
现在我有
void B::print()
{
std::vector<A>::iterator it;
for(auto it = m_vA.begin(); it != m_vA.end(); it++) {
cout << *it.getVal() << endl;
}
}
我得到了这个错误:
error: no member named 'getVal' in 'std::__1::__wrap_iter<A *const *>'
我不明白为什么
谢谢你的帮助