devxlogo

Tip Bank

Retrieve Localization Strings

Use this API function wrapper to retrieve localization and personalization information: Private Declare Function GetLocaleInfo Lib _ “kernel32” Alias “GetLocaleInfoA” (ByVal _ Locale As Long, ByVal LCType As Long, ByVal

Learning C++ From Scratch?

One of the most frequently asked questions I receive is: “How can I learn C++?”. First, remember is that C is not a pre-requisite for learning C++. In fact, as

Give Meaningful Names to Magic Numbers

“Magic numbers” are arbitrary constant values that indicate array bounds, maximal number of open files, the size of a memory page, and similar environment and program-specific units. Instead of using

Using Command Line Arguments

You can directly pass arguments to a program. For this purpose, you have to declare these arguments in the parameter list of main(): int main (int argc, char ** argv){}

Use Explicit Access Specifiers

C++ provides default access specifiers when you don’t use spell them out explicitly, as in the following examples: struct Employee{ /*..*/};class Manager : Employee //implicit public inheritance{ int rank; //implicitly

Guidelines for Overloading the + Operator

The built-in + operator is a binary operator that takes two arguments of the same type and returns the sum of its arguments without changing their values. In addition, +

The offsetof Macro

The macro offsetof (defined in or in C) calculates the offset in bytes of a struct’s data member. The following example uses this macro to calculate the offset of two

The Boost Web Site

The Boost web site offers various free C++ libraries and classes. These supplementary libraries and classes include a random number generator, four smart pointer classes, file system tools, timer classes,