In C++, on object creation, is new used implicitly?

c++, oop

Solution

In the first case, if `a` is not a global variable, then it will be put on the stack, while `b` will be put on the heap.

And in the first case, only the constructor is called. `new` is never called except if you do it explicitly as in the second case.

Problem

When I create an object of a class, say, ``` class A { public: A() {} }; A a; ``` Is only the constructor called? Or is it that the `new` operator is used implicitly? Like we have to do `A* b = new A();` Also, where will `a` and `b` be stored in memory? Stack or heap?

Original source