Saturday, 5 May 2012

Program Of Conversion Between Basic to Object In C++

#include<iostream.h>
#include<conio.h>
class add
{
int a;
public:
add(int x)
{
a=x;
}

{
return a;
}

void show()
{
cout<<"a is="<<a;
}
};
main()
{
clrscr();
int r;
add a1(4);
a1.show();
                    r=a1;           // Basic to Object
cout<<"\n Value of r="<<r;
getch();
}

No comments:

Post a Comment