求大神解答。。很急
#include<iostream>
using namespace std;
class Human{
public:
void get_high(int x){
high=x;
cout<<high<<endl;}
void get_weight();
public:
int high;
int weight;
};
void Human::get_weight(int y){weight=y;
cout<<weight<<endl;}
int main(){
Human wlh;
wlh.get_high(170);
wlh.get_weight(60);//編譯器指出這條語句出現問題,,出錯在哪呀。。求指教
return 0;
}
2015-04-18
在Human的定義中,get_weight()的參數為空,應該是get_weight(int y);