Posts Tagged initialization

C++ For C# Developers: Part 52 – Idioms and Best Practices

Tags: , , , , , , , ,

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.

Read the rest of this article »

6 Comments

C++ For C# Developers: Part 20 – Implicit Type Conversion

Tags: , , , ,

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.

Read the rest of this article »

2 Comments

C++ For C# Developers: Part 13 – Initialization

Tags: , , , , ,

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!

Read the rest of this article »

5 Comments

C++ For C# Developers: Part 12 – Constructors and Destructors

Tags: , , ,

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!

Read the rest of this article »

10 Comments

C++ For C# Developers: Part 9 – Enumerations

Tags: , , ,

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!

Read the rest of this article »

7 Comments

C++ For C# Developers: Part 3 – Variables and Initialization

Tags: , , , ,

Today we continue the series by introducing variables and how they’re initialized. This is another basic topic with surprising complexity for C# developers.

Read the rest of this article »

5 Comments