Advertisement
Guest User

Untitled

a guest
Aug 30th, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. class overload
  4. {
  5. int a;
  6. public:
  7. overload(){a=0;}// no initializer
  8. overload(int x){ a=x;} // initializer
  9. int get_value()
  10. {
  11. return a;
  12. }
  13. };
  14.  
  15. int main()
  16. {
  17. overload ob(10);
  18. overload ob1;
  19. cout<<"ob= "<<ob.get_value()<<endl;
  20. cout<<"ob1= "<<ob1.get_value()<<endl;
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement