top of page
Blog
Damiano Pe
Nov 2, 2021
The Difference Between const int * And int *const
An easy way to remember whether it is the pointed value or the address stored in the pointer variable to be constant is to read the...
100
Damiano Pe
Oct 23, 2021
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...
25
Damiano Pe
Oct 23, 2021
Never Use gets To Read A Line
gets is a deprecated function which can cause buffer overflows, use fgets insted.
19
Damiano Pe
Oct 23, 2021
How To Remove Trailing Newline Character From fgets Input
Let's say we have to process a text file line by line, and we have to make sure that the line we are processing does not end with a newline
27
Damiano Pe
Oct 23, 2021
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
26
Damiano Pe
Oct 23, 2021
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...
30
Damiano Pe
Oct 23, 2021
Declaration VS Definition: What's The Difference
In C and C ++, we must understand the difference between declaration and definition. Studying these languages, we often hear about them...
41
bottom of page