How am I still able to access the value? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 2

How am I still able to access the value?

How am I still able to access the value even after clearing up the memory? Does the values stay even after deleting the allocated memory? https://code.sololearn.com/c46Ra6rCoxw7/?ref=app

24th Sep 2020, 6:21 PM
OfcourseitsRohit
OfcourseitsRohit - avatar
4 Antworten
+ 1
No. It just tells the processor that now that memory is freed so it can reused by other processes... Edit : see this for better explanation Christian Grey https://www.sololearn.com/Discuss/2209606/?ref=app
24th Sep 2020, 7:30 PM
Jayakrishna 🇮🇳
+ 1
Jayakrishna🇮🇳 but why is the value still available after clearing the memory?? Because clearing the memory must clear the value too rgt?
24th Sep 2020, 7:21 PM
OfcourseitsRohit
OfcourseitsRohit - avatar
24th Sep 2020, 7:57 PM
OfcourseitsRohit
OfcourseitsRohit - avatar
0
It will remain until in overridden by other processes and compiler specific. If don't delete then other processes can't use that memory...
24th Sep 2020, 6:58 PM
Jayakrishna 🇮🇳