Complete, Concrete, Concise

Practical information without the bloat

C

Preprocessor – the #else Directive

#else is one of five preprocessor selection statements allowing selection of alternative sections of code for compilation. The other four selection statements are: #ifdef, #ifndef, #if, and #elif. Behaviour of this preprocessor directive is the same for both C and C++ compilers. Purpose The #else directive provides a final alternative for a preprocessor selection block. […]

C

Preprocessor – the #ifndef Directive

Behaviour of the #ifndef directive is the same in both C and C++. Purpose The #ifndef directive is one of five preprocessor selection statements allowing selection of alternative sections of code for compilation. The other four selection statements are: #ifdef, #if, #elif, and #else. Format #ifndef macro name valid preprocessor or code statements #endif or […]

C

Preprocessor – the #elif Directive

This (along with the #if directive) is probably the second most complicated preprocessor directive because the controlling expression can be complex and include tricky macro replacements. #elif is one of five preprocessor selection statements allowing selection of alternative sections of code for compilation. The other four selection statements are: #ifdef, #ifndef, #if, and #else. Behaviour […]

C

Preprocessor – the #if Directive

This (along with the #elif directive) is probably the second most complicated preprocessor directive because the controlling expression can be complex and include tricky macro replacements. #if is one of five preprocessor selection statements allowing selection of alternative sections of code for compilation. The other four selection statements are: #ifdef, #ifndef, #elif, and #else. Behaviour […]

C

Preprocessor – the #ifdef Directive

Behaviour of the #ifdef directive is the same in both C and C++. Purpose The #ifdef directive is one of five preprocessor selection statements allowing selection of alternative sections of code for compilation. The other four selection statements are: #ifndef, #if, #elif, and #else. Format #ifdef macro name valid preprocessor or code statements #endif or […]

C

Preprocessor – Understanding the defined Operator

This is the least known of the preprocessor operators. The other two operators are the token pasting operator (##) and the stringizing operator (#). The behaviour is the same for both C and C++ compilers. Format defined macro_name or defined ( macro_name ) Use The defined operator is used to check if a macro_name has […]

C

Preprocessor – the #include Directive

Behaviour of the #include directive is the same in both C and C++. Purpose It is used to include / insert / copy paste the contents of the specified file into the current file. Format #include <file name> or #include "file name" or #include preprocessor tokens All preprocessor directives begin with the # symbol. It […]

Writing

Writing Quickly

In another post, I had written that writing is hard because we get frustrated that the process of writing is so much slower than our process of creating. Notwithstanding that, we often make the process even harder by writing even slower than we are capable. The medium (the material) that a writer works with is […]

Blog

Jetpack Site Stats can be Misleading

I have the Jetpack plugin installed and use the Stats module in it to monitor activity on this site. It gives the following notice: Keep in mind we don’t count your own visits. Unfortunately, this is not completely true – if you are not logged in, it will count your visits to your site. To […]

Joomla

Adding Adsense to Your Joomla! 1.6 Site

This tutorial shows you how to display Google Adsense ads on your Joomla! 1.6.x website without installing an extension. Requires you have a Google Adsense account. Should work for other ad providers that provide you with a code snippet for ads on your site. Joomla! 1.6 is now obsolete and Joomla.org no longer provides support […]

C

Preprocessor – the #undef Directive

Behaviour of the #undef directive is the same in both C and C++. Purpose It is used to undefine a macro. A macro is an identifier (or label) followed by replacement text. There is only a single namespace for macros. A program which redefines an existing macro is considered to be malformed – even though […]

C

Preprocessor – The #define Directive

This is the most complicated of the preprocessor directives (a little over 7 pages is devoted to it in the C99 spec and the C++98 spec devotes about 4 pages to it). Behaviour of the #define directive is the same in both C and C++. C99 added variable argument macros; the upcoming C++0x standard adds […]