Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. class One
  2. {
  3. int value;
  4. public:
  5. void set(int a)
  6. {
  7. value=a;
  8. }
  9. void print();
  10. int getValue();
  11. };
  12.  
  13. void One::print()
  14. {
  15. cout<<"value="<<value<<endl;
  16. }
  17.  
  18. int One::getValue()
  19. {
  20. return value;
  21. }
  22. void main()
  23. {
  24. One obj;
  25. obj.set(5);
  26. obj.print();
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement