Look at the tow declarations bellow. These two method make any different in C++ 11? I checked the story about C++03 here
Class A{int m;}
A* a = new A
A* a = new A();
Look at the tow declarations bellow. These two method make any different in C++ 11? I checked the story about C++03 here
Class A{int m;}
A* a = new A
A* a = new A();
It's the same in C++11 as it was in C++03.
The first is default-initialision, leaving m
uninitialised.
The second is value-initialisation, initialising m
to zero.
If the class had a user-provided default constructor, then both would do the same thing, calling that constructor.