C++ Questions

C++: Why does changing 0.1f to 0 slow down performance by 10x?

Why does this bit of code, const float x[16] = { 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, ...
Read More

C++: What is The Rule of Three?

What does copying an object mean? What are the copy constructor and the copy assignment operator? When do I need ...
Read More

C++: When should static_cast, dynamic_cast, const_cast and reinterpret_cast be used?

What are the proper uses of: static_cast dynamic_cast const_cast reinterpret_cast C-style cast (type)value Function-style cast type(value) and how does one ...
Read More

C++: Operator overloading

What are the basic rules and idioms for operator overloading in C++? Note: The answers were given in a specific ...
Read More

C++: What are the differences between a pointer variable and a reference variable in C++?

I know references are syntactic sugar, so code is easier to read and write. But what are the differences? Summary ...
Read More

C++: What does the explicit keyword in C++ mean?

Someone posted in a comment to another question about the meaning of the explicit keyword in C++. So, what does ...
Read More

C++: Why is one loop so much slower than two loops?

Suppose a1, b1, c1, and d1 point to heap memory and my numerical code has the following core loop. const ...
Read More

C++: Split a string in C++

What’s the most elegant way to split a string in C++? The string can be assumed to be composed of ...
Read More

C++: Cycles in family tree software

I am the developer of some family tree software (written in C++ and Qt). I had no problems until one ...
Read More

C++: What is the name of the “–>” operator?

After reading Hidden Features and Dark Corners of C++/STL on comp.lang.c++.moderated, I was completely surprised that it compiled and worked ...
Read More

Subscribe now to receive more great content like this!