NULL pointer | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок

NULL pointer

Could anyone explain null pointer..

16th May 2020, 6:50 PM
Kumudu_Mohottala - avatar
1 ответ
+ 2
If you want a pointer to point nowhere, you can give it the value 'nullptr'. Normally when you declare a pointer but you don't initialize it, it may just point somewhere (and you are not certain what is located at that memory location). But if you assign the value 'nullptr' to the pointer, it just points nowhere. The advantage is that you (for example) don't accidentally alter the memory at some random memory location
16th May 2020, 7:26 PM