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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -