Using NULL and nullptr in C++ is similar but not exactly the same: What is NULL? NULL is just 0 in disguise. It's not specifically for pointers, so it can cause confusion in some cases. What is nullptr? nullptr is designed only for pointers. It’s safer and easier for the compiler to understand. Why use nullptr? If you use NULL, the compiler might get confused between numbers and pointers. Use nullptr in modern C++ because it’s safer and avoids mistakes.
#include
int main()
{
int *pointer = nullptr;
int x = 123;
pointer = &x;
if(pointer == nullptr){
std::cout
i dereferenced an unassigned pointer once, now im homeless
😭
the blow up was so unexpected lol
CrowStrike should have watched this video. LOL
🤣
I wanna try. Will there be any problem If I try it on my lappy
Never new a word as perfect as NULL existed for me
Excelent video as always. I hope you teach us more about C++ in the future!
I deeferenced an unassigned pointer in an UE project... what project? 😅
if i assign NULL to the pointer while declaring it, will it work the same as nullptr or there will be a difference ?
Using NULL and nullptr in C++ is similar but not exactly the same:
What is NULL?
NULL is just 0 in disguise. It's not specifically for pointers, so it can cause confusion in some cases.
What is nullptr?
nullptr is designed only for pointers. It’s safer and easier for the compiler to understand.
Why use nullptr?
If you use NULL, the compiler might get confused between numbers and pointers.
Use nullptr in modern C++ because it’s safer and avoids mistakes.
Good Video.
Bro I wanna try it, but will it actually blow up my computer?
Bruuuh ...It did nothing it just returned a value of 3221225477 instead of 0 and took 3 seconds to execute
lmao🤣🤣🤣
@@adamkherbek586 imagine you did this for the big projects🤣🤣🤣
😅😅
It showed me Permission denied error
AD HƯỚNG DẪN VỀ CẤU TRÚC DỮ LIỆU VÀ GIẢI THUẬT ĐI
noi tieng viet sao ma no hieu ba
@@khoanguyen-px5yc sử dụng PC sẽ hiểu
can someone give me a spoiler of what would really happen if i deference a nullptr
You get a nullptr error that's all.
Todays lesson: never outputs nullptrs or else...