#include <iostream>
using namespace std;
class Rectangle;
int main(){
Rectangle myRoom(5,10);
cout << myRoom.getHeight() << endl;
cout << myRoom.getLength() << endl;
system("pause");
return 0;
}
class Rectangle{
private:
int height;
int length;
public:
Rectangle(int aHeight, int aLength){
height = aHeight;
length = aLength;
}
int getHeight(){
return height;
}
int getLength(){
return length;
}
};
Compiler is telling me that Rectangle, getHeight, and getLength are undefined. Why is it that my class Rectangle is not being prototype'd so that I can define it under the main method? Could someone tell me what I'm doing wrong? Thank you.