Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class C
- {
- private:
- string A;
- double B;
- public:
- //empty constructor
- C();
- C(string, double);
- }
- //this is how I declare the empty constructor
- C::C()
- {
- }
- C::C(string a, double b)
- {
- A = a;
- B = b;
- }
- C::C() : B() {} // zero-initializes B
- C::C(const string& a, double b) : A(a), B(b) {}
- C::C()
- :B(0.0)
- {
- }
- C(const string& a= "", double b= 0.0)
- : A(a),
- B(b)
- {
- }
- class Bar{
- private:
- Bar(); //Explicitly private;
- };
- Bar b;
- C::C(string a, double b):A(a), b(b)
- {
- }
- C() = default;
- int m_member = 0; // this is a class member
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement