mardi 18 septembre 2018

Copy pointer content to stack variable

I have this doubt that came to my mind. Is this possible? Consider this code:

int* p;
int j = 9;
p = &j;
// is it possible to declare int x and store inside 9?
// so if I do delete p; that value is stored in x

Thanks in advance and regards

Aucun commentaire:

Enregistrer un commentaire