Can someone explain to me why I cannot do something according to:
int* b = new int(5);
int* c = new decltype(*b)(5);
cout << *c << endl;
This calls C464 'int &': cannot use 'new' to highlight the link. How will I do something like this? What I need is the scattered base type of the variable I'm sending.
It works though
int* b = new int(5);
int** a = new int*(b);
decltype(*a) c = *a;
cout << *c<< endl;
I understand how the code above works, but how can I do something like this with a new one?
source
share