Why are there multiple ways of initializing variables in c++ instead of just one? From my knowledge you can do these:
int x = 0;
int y (2);
int c {3};
Thanks!
Why are there multiple ways of initializing variables in c++ instead of just one? From my knowledge you can do these:
int x = 0;
int y (2);
int c {3};
Thanks!
Oh, it is because , all of datatypes are an object. They all have blind initializers, that is same as the default-constructor(initializer) of the classes.