c++ - A *a = new A(); Does this create a pointer or an object? -
a *a = new a(); does create pointer or object?
i c++ beginner, want understand difference.
both: created new instance of a (an object), , created pointer called a.
you separate 2 statements:
a *a;        // declare `a` of type: pointer `a`  = new a(); // create new instance of `a` ,              // assign resulting pointer `a` 
Comments
Post a Comment