C

Programming Error – Unintended String Concatenation

In an effort to be helpful, C and C++ compilers concatenate adjacent strings together. In the following example, the compiler will concatenate the two strings into a single string: printf("This is a string " "and this is another string."); Which is probably what you intended anyway. Because C and C++ are free form languages, adjacent […]

WordPress

All Your Content has Vanished / Error 404 on All Pages

These instructions are for WordPress 3.X that is being hosted on a web server that provides access via cPanel version 11.34.1. The instructions may be the same or similar for other version combinations or interfaces other than cPanel, but no guarantees are made. Possible Symptoms You may encounter one or more of the following symptoms: […]

Blog

w.bloggar – How to Fix "Unable to parse the XML response" Error

I am probably one of the few, if only people around who use w.bloggar for my blogging needs. While it is an old and outdated program, it has three essential features for me: (1) customizable edit keys (that’s how I input these coloured sections without typing in HTML code), (2) it is easy to upload […]

C

Preprocessor – the #error Directive

Preprocessor – the #error Directive This is a very useful and often underused preprocessor directive. Behaviour of this preprocessor directive is the same for both C and C++ compilers. Purpose The #error directive terminates compilation and outputs the text following the directive. Format #error text All preprocessor directives begin with the # symbol. It must […]

C

Compilation Error – Improperly Defined Macro

Macros are tricky things to use in C/C++ programming. When they work, they work great. When they have bugs, they are a pain to troubleshoot. Macros are a simple text substitution done by the preprocessor. Whenever the macro name is encountered in your code, the preprocessor replaces it with the text to the right of […]

C++

Programming Error – Incorrect Array Declaration

In C++, we can declare an array by using the new operator: char *p = new char[50]; // dynamically allocate an array of 50 char This is useful in functions when we don’t know in advance how large the array should be or if we want to allocate the array in the heap instead of […]