I have a very basic doute concerning dynamic allocation. Studying the tree following possible syntaxes I have been said that they all are dynamic allocations.
First:
int* px(nullptr);
px = new int;
*px =20;
Then a more concise one:
int* px(nullptr);
px = new int(20);
Or even:
int*px(new int(20));
Then in a second moment in the same explanation I have been told that the third case is actually a static allocation. Than I got confused.
Is that true? Could someone explain me why please?
Many thanks.