default value in class c++ code example
Example: how initilaize deffult value to c++ class
class X {
int i = 4;
int j {5};
public:
X(int a) : i{a} {} //initializes with a and 5
X() = default; //initializes with 4 and 5
};
class X {
int i = 4;
int j {5};
public:
X(int a) : i{a} {} //initializes with a and 5
X() = default; //initializes with 4 and 5
};