April 5, 2000

Don’t Forget the Null

A valid C string consists of an array of zero or more characters plus an additional null character. Thus, the shortest possible string must contain at least one character. Remember

The Prototype of Main()

In pre-standard C++, the prototype of main() didn’t have a return value. On some compilers, it was: main() /* no explicit return value; int assumed*/ While others used one of

Remove “Dead Declaration” From Your Code

Applications constantly undergo modifications, bug fixes, and customization. Programmers often remove pieces of obsolete code that use a variable while leaving the declaration of that variable intact. A clever compiler

Tackling a Common Bug With scanf()

In legacy code and environments that support C exclusively, using scanf() is still a widespread method of getting input from a user (or a file, when using fscanf()). When using

Is Learning C a Waste of Time?

One of the frequently asked questions I receive is: “I’m learning C at school/college/from a book. Am I wasting my time learning this language? Should I be learning C++ instead?”