GoingDeep: Stephan T. Lavavej: Everything you ever wanted to know about nullptr

GoingDeep

In C++, 0 is an abused integer. It is used to reflect, well, 0 as a value of type int and it is also used to represent a null pointer... The latter has led to many bugs and confusion over the past 30 years. Put simply, using 0 is and has always been a bad idea (then there's the NULL macro...). We.

Running time
1h0m
File size
28.00MB

Download Original File | View original post

Episode synopsis

In C++, 0 is an abused integer. It is used to reflect, well, 0 as a value of type int and it is also used to represent a null pointer... The latter has led to many bugs and confusion over the past 30 years. Put simply, using 0 is and has always been a bad idea (then there's the NULL macro...). Well, my friends, today, with the release of Visual Studio 2010 Beta 2 and the updated C++ language, compilers and libraries that come with it, the abuse of 0 comes to an end: Introducing nullptr the rvalue constant that actually is a null pointer literal.

Who better to dig deep into nullptr (and a few other topics of related interest and importance) than the great and gifted Stephan T. Lavavej? Stephen is a C++ expert and library author who you've met before a few times on C9. Sit back, relax and learn everything you ever wanted to know about nullptr. Thank you, Stephen, for the awesome lesson!

Enjoy!

VC Team Blog: http://blogs.msdn.com/vcblog/default.aspx

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Measuring programming progress by lines of code is like measuring aircraft building progress by weight.” - Bill Gates