If a standard library function name like printf is misspelled as 'print', the compiler will not flag it as a syntax error. Instead, the linker will fail because it cannot find a matching library function.
C treats uppercase and lowercase letters as completely distinct. For example, the identifiers 'a1' and 'A1' are stored in separate memory locations and represent different variables.
The scanf function requires the ampersand (&) operator before variable names, such as &integer1. This passes the memory address of the variable rather than its current value.
In C, dividing two integers always results in an integer. Any fractional part is truncated, meaning that the expression 7 / 4 evaluates to 1, not 1.75.
The remainder operator (%) can only be used with integer operands. Attempting to use the % operator with floating-point numbers will result in a compilation error.
Arithmetic expressions must be written in straight-line form, such as a/b, to be accepted by compilers. Standard algebraic fractional notation is not valid syntax.
Programmers can use unnecessary parentheses, known as redundant parentheses, to group subexpressions. This is a recommended practice to make complex calculations easier to read.
While almost all arithmetic and relational operators associate from left to right, the assignment operator (=) associates from right to left, evaluating the right-side expression first.
Keywords such as 'int' and 'if' have predefined meanings in C. They are reserved by the compiler and cannot be used as custom names for variables or functions.
To prevent security vulnerabilities associated with single-argument printfs, the CERT C Secure Coding Standard recommends using the puts function to print strings that end with a newline.
When printing a string without a newline, using printf with two arguments, such as printf("%s", "Welcome "), is a secure coding practice that prevents format string exploits.