CS2931 - Fall 2003 - Some Common Errors in C
More will be added as we proceed:
-
The char 'x' is not a string "x".
-
= is not = = ; & is not && etc.
-
left association effects:
a < b < c is meaningful, but not as the conjunction of inequalities
-
& is required for scanf(); it and printf() expect string, not char arguments;
both require: #conversions = #arguments
-
avoid overflow when using INT_MAX eg use i < INT_MAX-j, NOT i + j < INT_MAX