请帮忙看下C++程序哪里出错了,谢谢~

2024-12-17 15:45:18
推荐回答(1个)
回答1:

#include
using namespace std;
class Dog//小写class
{
public:
void setDog(int A=0,int B=0);
void showDog();
private:
int age,weight;
};//分号
void Dog::setDog(int A,int B){
age=A;
weight=B;
}

inline void Dog::showDog(){
cout<}

int main(){
Dog myDog;
cout<<"first Dog set:"< myDog.setDog();
myDog.showDog();
cout<<"set Dog:"< myDog.setDog(2,30);
myDog.showDog();
return 0;
}