What design problem does the following program have?
来源:百度知道 编辑:UC知道 时间:2024/06/19 04:43:18
What design problem does the following program have?
#include <iostream>
using namespace std;
class Critter
{
public:
int GetHunger() const {return m_Hunger;}
private:
int m_Hunger;
};
int main()
{
Critter crit;
cout<< ctri.GetHunger()<<endl;
return 0;
}
Thanks!!
手误:
cout<< crit.GetHunger()<<endl;
#include <iostream>
using namespace std;
class Critter
{
public:
int GetHunger() const {return m_Hunger;}
private:
int m_Hunger;
};
int main()
{
Critter crit;
cout<< ctri.GetHunger()<<endl;
return 0;
}
Thanks!!
手误:
cout<< crit.GetHunger()<<endl;
m_Hunger变量你还没初始化,同时Class Critter中你应该提供对他初始化的方法。
1.Missing ';' behind 'int GetHunger() const {return m_Hunger;} '
2.You should initialize member variable first before using it.
initialize m_Hunger
What design problem does the following program have?
what is landscape design谁能用英文解释“什么是景观设计”
gave me serious excellent Counsel against what he foresaw was my Design.
Design Patten3
What Chinese Star can support with XP Pro SP2?
什么是design house
海尔design流程
Design Cappuccino怎么翻译?
design和BY是什么意思??
design 文根英中文发音