Enabling NumLock on by DefaultTo have numlock turned on for each user: Start Regedit Go to HKEY_CURRENT_USER\Control...
The #error Preprocessor Directive During the preprocessing phase, you can report errors by using the #error preprocessor directive. For example,...
Does the Compiler Always Create a Default Constructor? The compiler creates a default construtor only in the following situations: * When...
Iterators Aren't Pointers Suppose you define a the following list object and you need the address of one of its elements: std::list <int>...
Why you shouldn't store auto_ptr objects in STL containers Most C++ users already know that they shouldn't use auto_ptr objects as elements of...
auto_ptr<>: your safe guard against memory leaks The Standard Library supplies the class template auto_ptr<> which automatically deallocates heap...
Beware of Aliasing Whenever your class contains pointers, references, or handles, you need to define a copy constructor and assignment operator....
Prefer References Over Pointers Even experienced C++ programmers who have prior experience with C tend to use pointers excessively whereas...
Uses of the ptrdiff_t Data Type C and C++ define a special type for pointer arithmetic, namely ptrdiff_t, which is a typedef of a...
Pointers to Members of a Template Class You can define a pointer to a class template member. For example, you can use the specialization...
No Pointer Arithmetics Outside Array Bounds! Sometimes it is tempting to let a pointer point to a location that is slightly beyond an array's...
Hide Function Pointer Declarations With a typedef Can you tell what the following declaration means? void (*p[10]) (void (*)() ); Only...
Declaring References to Functions You can declare a reference to a function, just like you can declare a pointer to a function. For example:...
Passing More Arguments to a Callback Function Callback functions have a fixed signature so you cannot alter the number or type of the arguments...
Never Use Incompatible Pointers to Member Functions A reader posted a message on one of the C++ newsgroups recently. He had to port a huge...
When Are Pointers Equal? Pointers to objects or functions of the same type are equal if and only if in they are both NULL: int *p1 =...
Avoiding Crashes Due to Multiple Deletes Many times, a program crashes due to multiple deletes on the same pointer. In some cases, this is due to...
Assigning a Specified Memory Address to a Pointer In low-level programming and hardware interfaces, you often need to assign a pointer to a...
'Restrict' Pointers One of the new features in the recently approved C standard C99, is the restrict pointer qualifier. This qualifier can be...
No Member-Function to Pointer-to-Member-Function Conversion Does you compiler accept the following code? class A { public:...
Separate names with a comma.