Both C++ and C# have lambdas, but they have quite a few differences. Today we’ll go into how C++ lambdas work, including all their features and how they compare and contrast with C# lambdas. Read on to learn all the details!
Now that we’ve seen how types are implicitly converted in C++, we can see how they’re explicitly converted by casting. C++ offers a lot more kinds of casts than C# to control the conversion process. One of them—
dynamic_cast—introduces the concept of Run-Time Type Information or RTTI, so we’ll go into that today as well.
We’ve actually seen quite a bit of implicit type conversion so far in the series. We’ve converted integers to floats (
float f = 123), arrays to pointers (
int* p = a), base type pointers to derived type pointers (
D* p = &b), and many more. Today we’ll gather all those casual conversions up into one article that goes over all the rules, including user-defined type conversions.
So far, all of the memory our C++ code has allocated has either been global or on the stack. For the many times when the amount of memory isn’t known at compile time, we’ll need dynamic allocation. Today we’ll go over both the basics of
delete, but also dive into some advanced C++ features such as overloading
new and “placement”
Like C#, C++ also uses exceptions as one of its main error-handling mechanisms. Today we’ll learn all about them: throwing, catching, their impact on destructors, what happens when they go uncaught, and so much more.
Today we’ll wrap up structs and classes by discussing a bunch of miscellaneous features: local classes, unions, overloaded assignment operators, and user-defined literals. C# doesn’t have any of these features, but it can emulate some of them. Read on to learn a bunch of new tricks!
Today we’ll cover the last major topic of structs in C++: how we control access to them. We’ll talk about access specifiers like
private, the “friendship” concept, and finally get around to the details of
Now that we know how to initialize structs and other types in C++, we can take a look at inheritance and learn how to make structs derive from each other. There’s a lot of extended functionality here compared to C# class inheritance. Read on to learn the basics as well as advanced features like multiple inheritance and virtual inheritance!