Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- class overload
- {
- int a;
- public:
- overload(){a=0;}// no initializer
- overload(int x){ a=x;} // initializer
- int get_value()
- {
- return a;
- }
- };
- int main()
- {
- overload ob(10);
- overload ob1;
- cout<<"ob= "<<ob.get_value()<<endl;
- cout<<"ob1= "<<ob1.get_value()<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement