Objects as automatic variable ? | developer.brewmp.com Objects as automatic variable ? | developer.brewmp.com

Developer

Objects as automatic variable ?

Forums:

Hello,

I have

class A
{
A()
{
[...]
};
;

and in the constructor I initialize some attributes.

Somewhere in another class I have :
A myvar;

But the constructor is not called to initialize the attributes.
Only if I use the new operator the constructor is called:
A *myvar= new A();

Are constructors not called for automatic variables in Brew C++ ?

Thx for helping !