Dev Tips

Understanding Strict-Aliasing Rules

The strict-aliasing rules allow the compiler to assume that your code does not alias between incompatible types. In this way, the compile...

How To Cast The Result Of malloc

A question that often arises when allocating a new block of memory in C is: should I cast the result of malloc or not?

The Meaning Of argc And argv In main()

The input parameters argc and argv are used to send arguments to a program. The program receives arguments thanks to argv, which is a poi...

The Correct Return Type Of main()

The return type of main must be int, not void. It returns zero to indicate successful termination, otherwise a non-zero value for an abno...

How To Properly Compare Strings

In C, we can't compare strings with == or !==. We have to use functions declared in the string.h header file. Let's see why and how to do it

How To Get The Size Of An Array

Sometimes we want to know the size or the number of elements of an array, perhaps because we want to create a for loop that processes eac...