Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. class C
  2. {
  3. private:
  4. string A;
  5. double B;
  6. public:
  7. //empty constructor
  8. C();
  9. C(string, double);
  10. }
  11.  
  12. //this is how I declare the empty constructor
  13. C::C()
  14. {
  15.  
  16. }
  17.  
  18.  
  19. C::C(string a, double b)
  20. {
  21. A = a;
  22. B = b;
  23. }
  24.  
  25. C::C() : B() {} // zero-initializes B
  26.  
  27. C::C(const string& a, double b) : A(a), B(b) {}
  28.  
  29. C::C()
  30. :B(0.0)
  31. {
  32. }
  33.  
  34. C(const string& a= "", double b= 0.0)
  35. : A(a),
  36. B(b)
  37. {
  38. }
  39.  
  40. class Bar{
  41. private:
  42. Bar(); //Explicitly private;
  43. };
  44. Bar b;
  45.  
  46. C::C(string a, double b):A(a), b(b)
  47. {
  48. }
  49.  
  50. C() = default;
  51.  
  52. int m_member = 0; // this is a class member
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement