Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. class JoesClass{
  6. public:
  7.  
  8. void setname(string x){
  9. x=name;
  10.  
  11. }
  12. string getname(){
  13. return name;
  14. }
  15.  
  16. private:
  17. string name;
  18. };
  19.  
  20.  
  21. int main(){
  22.  
  23. JoesClass jo;
  24. jo.setname("Wolverine");
  25. cout<<jo.getname();
  26. return 0 ;
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement