Saturday 2 July 2016

c++ - Why or when to declare an int with a pointer?

Is there any difference between these two other than their duration?



int ptr;
int *ptr = new int;



I understand the concept of pointers but I don't see a much of a use for for delcaring an int with a pointer.

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...