Professional Documents
Culture Documents
Requesting Help From Sir Hassan
Requesting Help From Sir Hassan
// It is the code that you gav us last time.. // Regarding the rectangle class.. with post fix added # include<iostream> # include<string> using namespace std; class Apple { private: int length; int width; int Area; void setArea() { Area= length * width ; }
// ********** public:
****************************
***********************
Apple operator++ (int n) // The post fix !! !! !! { Apple temp(0,0); cout<<"postfix operation"<<endl; temp.width=width++; // we do postifx say in the width .. .. .. this 'll autmtclly chnge the width temp.length= length++; return(temp); }
void DisplayAll () // It is a PUBLIC function tht can access the private function of set area ... ... { cout<<"This is the display function "<<endl; setArea(); getArea(); }
obj1.DisplayAll(); // Main display function called.. it contains set/get area.. } // prog ends
// The problem iz: "Set Area" and "The Postfix functn does not works".. // Its a 'logical or syntax' error.. // the main prob is that the set area function does not "works".. // Ahh i'm crash-overloaded..
// BTW Happy Eid Mubarak Sire !!! Hav a wonderful cheerful nd tasty Barka EiD ... (But after solving my code) :) // Thank you sir // My email (if needed): fakhirkhan77@yahoo.com