Somewhere in a blog I saw this line:
class A{
private:
int x;
A(int x=0): x{x} {cout<<"hello";}
};
can anyone please clear what this line means:
(int x=0) : x{x}
with the constructor.
Somewhere in a blog I saw this line:
class A{
private:
int x;
A(int x=0): x{x} {cout<<"hello";}
};
can anyone please clear what this line means:
(int x=0) : x{x}
with the constructor.