Friday, May 1, 2009

inside declaration of the member function

inside declaration of the member function

header files
class addition // class declaration
{
int a,b,c; // data member declaration
public:
void get()
{
cin>> a >> b;
c=a+b;
}
void put()
{
cout<<"Result is C=" << c;
}
};
void main()
{
clrscr();
addition obj;
obj.get(); // object creation
obj.put(); // object calling
getch();

}

No comments:

Post a Comment