这个工程的main函数提示getArea第一次使用,但是我明明已经声明并定义过了
#include<cstdlib>#include<iostream>#include"Rectangle.h"usingnamespacestd;intmain(int...
#include <cstdlib>
#include <iostream>
#include"Rectangle.h"
using namespace std;
int main(int argc, char *argv[])
{
Rectangle a;
Rectangle b(2,3);
cout<<getArea(2,3)<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
#include<iostream>
#include"Rectangle.h"
using namespace std;
int Rectangle:: getArea(int w,int h){
return w*h;
}
Rectangle::Rectangle(){
cout<<"finish"<<endl;
}
Rectangle::Rectangle(int w,int h){
h=h;
w=w;
cout<<"done"<<endl;
}
class Rectangle{
int w,h;
public:
int getArea(int w,int h);
Rectangle();
Rectangle(int w,int h);
}; 展开
#include <iostream>
#include"Rectangle.h"
using namespace std;
int main(int argc, char *argv[])
{
Rectangle a;
Rectangle b(2,3);
cout<<getArea(2,3)<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
#include<iostream>
#include"Rectangle.h"
using namespace std;
int Rectangle:: getArea(int w,int h){
return w*h;
}
Rectangle::Rectangle(){
cout<<"finish"<<endl;
}
Rectangle::Rectangle(int w,int h){
h=h;
w=w;
cout<<"done"<<endl;
}
class Rectangle{
int w,h;
public:
int getArea(int w,int h);
Rectangle();
Rectangle(int w,int h);
}; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询