Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. class danielClass{
  8. private:
  9. int source;
  10. public:
  11. danielClass(int p){setSource(p);} //constructor - used to set default values when the object is created
  12. ~danielClass(){cout << "\n\nShit son it's gone";} //ran when the object is destroyed
  13.  
  14. void setSource(int p){source = p;}
  15. int _getSource(){return source;}
  16.  
  17. };
  18.  
  19.  
  20.  
  21. int main()
  22. {
  23.  
  24. danielClass testClass(10); //creates an object off the class
  25. cout << testClass._getSource;
  26.  
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement