Im currently working hard on learning c++ and I would appreciate
any help with this problem.
I want this program to check if the rectangles area equals 100 and then take an action based on that check. I want to do the check in a separate function and have the function return 1 if it equals 100 and 0 if it doesn't. The "rectangle" class works fine with all other programs so that is not the problem.
By the way, this program isn't any serious one. I just wrote it to illustrate my problem.Code:#include <iostream> #include <rectangle.h> using namespace std; int checkarea(rectangle *recta); int main() { rectangle rect; cout<<"The area is: "<<rect.GetArea()<<endl; if(checkarea(&rect)!=0); { return 0; } cout<<"End of main()."<<endl; return 0; } int checkarea (rectangle *recta) { if (recta->GetArea()==100) //I didn' really know { //if I should have used cout<<"recta->GetArea() is 100."<<endl; //the dot return 1; //operator instead of -> } //here. cout<<"End of checkarea()."<<endl; return 0; }