What exactly is NULL?

preview_player
Показать описание


This video is sponsored by Brilliant.
Рекомендации по теме
Комментарии
Автор

I'm an old-time hardware/assembly programmer who progressed to C in the late 80's, which I found natural. In the mid 90's, I made a move to C++ and somehow just lost confidence in my ability to understand what was actually going on under the hood. As more and more features were added, I avoided them as "black magic". Your series has rekindled my confidence that it's still just bits and bytes. Thank you!

BM-jycb
Автор

I miss the c++ series so much every one is a banger

metubr
Автор

C++ isn't even my main language, but holy moly you learn so much from these deep dive videos it's insane.
Keep up the amazing video quality Yan

uMadBrudi
Автор

there was a day where compilers didn't care if you used an uninitialized pointer and would just do undefined behavior, made some things really difficult.

xDeadCde
Автор

Dude seriously after 10 years of working in C++ you keep giving me so much input about stuff I didn't know before. keep going.

giantsue
Автор

12:33 "We don't care about self, at all." That got dark suddenly 🤣

olo
Автор

I like how you explain the mechanism instead of just saying "do this and this", what many people on youtube do. Nothing new for me, but people can actually learn from this kind of content, so props to you.

jbird
Автор

Thanks Cherno for these videos, you’re such an amazing teacher! I hope your C++ series will cover all stuff that is used in C++ programing at some point(if thats eaven possible). It’s already one of the best places for someone to learn C++ (apart from a person coding themselves) and I think it would be amazing for someone to be able to just open your playlist and find anything they need C++ oriented.

mladen
Автор

I swear to GOD that I was havning a conversation about NULL at exercism with a mentor, and came here to YT after having finished asking my question, and here the Cherno is, having upped a video about NULLs and yt recommending it after 3 mins of upload. I feel connected lol

ycombinator
Автор

Still the best C++ series out there! Could you please make a video about files in C++ ?

avivpk
Автор

Dude I literally love your videos. Even just you showing how you can inspect the physical memory like that?? Never knew that and that's sooo cool.

alecmather
Автор

One of the best videos I've seen on C++. I especially liked the part that had covered the implementation of C++ classes in terms of C structs and C functions.

alex_
Автор

Might be interesting to mention that C++ does not care whether or not you want to access a nullptr. It compiles fine. There is a memory management unit (MMU) in your PC that the OS will configure, usually making the first page of memory inaccessible. This is what makes reading from null an access violation.

I work in embedded software with C, and before the bootloader configures the MMU, 0 is a valid address. We actually use this area of memory to store data. This is because the bootloader runs on internal CPU memory which is very limited. After initializing the external RAM we use the lowest page to store data which would not fit in the internal RAM. This is fine because the application will never be able to access this data once the MMU is configured correctly.

mananasi_ananas
Автор

If you want to hear something cursed, C (not sure about C++) compilers are required to give null pointers the value of 0, but their memory representation (like many representations within C) is undefined. This means that setting pointers to 0 and comparing pointers to 0 will work as expected, but only if you do so through a correct type (i.e. T*).

This means for example, that calloc-ing memory to hold a pointer (or a struct containing pointers) will not necessarily give you null pointers. Same with memset, or any other way of setting the raw bytes of its value. My reading of the spec suggests that using struct foo bar = { 0 } style initializations will give the correct pointer representation.

benjaminclehmann
Автор

Great work Cherno! C++videos is a masterpiece, hope you can keep producing it !!!

Albert-lrky
Автор

This series is precisely what they need to teach at Universities. Entertaining, simple but detailed, easy to follow, goes into what (at least my own) University will not go into. I had lost interest in programming due to my crappy Uni course, but thanks to Cherno, I am back and happier than ever to be programming. Thank you so kindly for making this series @The Cherno, I hope to see much more in the future!

DTGplays
Автор

I was just looking into defining extension methods in C# and found the syntax a bit unusual. Now I totally understand why they are written the way they are. It's kinda like what you explained but in reverse. Really interesting! Thanks :))

andrasvermes
Автор

9:21 For the record, that is only true for structs in C. In C++, structs can have functions(=methods) -- even virtual ones --, constructors, public, private and protected members, use inheritance, be templated… just like a class.

andrisszalai
Автор

holy crap this is awesome, you just became one of my favorite programming youtubers

hectormejia
Автор

I usually get kind of lost in your videos 'cause they a bit advanced for me. But this one was at an epiphany level. So clear and reachable. Thank you

ivansirtautas