I have a simple class with two objects in main(). Are there any differences in the initialization of the constructor ?
//#include <systemd/sd-bus.h> #include <iostream> #include <memory> class Simple { private: int a; public: Simple(int b) : a(b) { } void show() { std::cout << a; } }; int main() { Simple firstObj = Simple(5); firstObj.show(); Simple secondObj(5); secondObj.show(); return 0; }