As a very large language used for a very wide range of purposes over many decades, C++ can be written in a lot of different ways. Today we’ll look at some of the norms for “modern” C++ to get a sense of how code is normally written.
Posts Tagged initialization
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.
With constructors under our belts, we can now talk about initialization of structs and other types. This is a far more complex topic than in C#. Read on to learn a lot of nitty-gritty details!
So far with structs we’ve covered data members, member functions, and overloaded operators. Now let’s talk about the main parts of their lifecycle: constructors and destructors. Destructors in particular are very different from C# and represent a signature feature of C++ that has wide-ranging effects on how we write and design code for the language. Read on to learn all about them!
We’ll continue the series today by discussing enumerations, which is yet-another surprisingly-complex topic in C++. We actually have two closely related concepts of enumerations to go over today, so read on to learn all about both kinds!
Today we continue the series by introducing variables and how they’re initialized. This is another basic topic with surprising complexity for C# developers.