This is the code.
int main(){ unique_ptr <int> p {nullptr}; int val = 100; p = &val; // Not working - compilation error p = move(&val); // Not working - compilation error cout << *p; return 0;}
What is the correct way?
Aucun commentaire:
Enregistrer un commentaire