July 20, 2001

A Way To Nest Multi-line Comments

You can use #ifdef & #endif to comment out a block of code that already has multi-line comments.For example: #ifdef COMMENTThis #ifdef removes all nested Code & Comments Code…/* Comments…*/

Understanding Linked Lists

A linked list is a dynamically created area where data can be stored. It contains certain algorithms for collecting data (alphabetically, numerically, etc.). This is like an array but an

Nested For Loop Optimization

You can declare the counter of even the most deeply nested loop as a ‘register’ variable. For example: for (int i = 0; i < 100; ++i){ for (register int

Internal and External Linkage

Global inline functions, consts and typedefs have internal linkage.That means that the declarations in these two files do not interfere with each other: //File1.c typedef int T; const int a

Listing Members in an Initialization List

This tips explains how to list members in an initialization list in the order in which they are declared. Take a class Array: class Array {private: int *m_piData; // ptr