This entry is for all the C++ die-hard programmers out there. Some of you may not know about some of the hidden features of C++. Have you ever struggled with trying to work with combining a regular variable and a const variable? Well, try this:
varType functionOfSomething(const varType & copy)
{
return *this = const_cast<varType & >(copy);
}
Just like that, I have casted away the const restriction of the variable and am now free to use it anyway I please. If I caught your interest with that you can also try looking up some of my other favorites: reinterpret_cast (changes types to other types), dynamic_cast, and static_cast. The last two are obvious for static type definitions. But, be careful with reinterpret_cast as it is a way to circumvent the C++ type-cast restrictions that make it a semi-safe language.
Use of these is considered bad programming by some, including myself. If I can, I try to avoid them. But, to hell with me, it makes some stuff really easy to write! They are also ISO C++ compliant and are supported on all standards compliant compilers like GCC, Visual Studios, and Borland. Have fun!