Common Mistakes

Day 1

  • Borland C++ 5.5 compiler configuration files named incorrectly or not put inside the bin folder resulting in compiler error.
  • Path to bin folder not set correctly (includes extra quotation marks surrounding the semicolons) resulting in error when trying to run the bcc32 compiler.
  • Missing brackets from the printf() function leading to program error.

Day 2

  • Forgetting to put the parentheses of the printf() function [repeat].
  • Putting an extra space after the percent sign % while formatting the output “% .1f”.
  • Forgetting to write the main() function line in the program!
  • Writing a dot instead of a coma before a variable inside printf(”%i” . z).
  • Saving a C source code file in a wrong folder then trying to compile it from within a different folder.

Day 3

  • Forgetting the opening double quotation marks in the printf() function.
  • Conducting a mathematical operation on a variable before first taking input from the user in that variable i.e. using scanf() after an assignment operation that includes the unassigned variable.
  • Forgetting the semicolon at the end of a statement.
  • Writing the \n escape sequence outside the quotation marks of the printf() function
  • Forgetting the ampersand sing & before the variable name in the scanf() function.

Day 4

  • Forgetting semicolon at end of statement [repeat].
  • Using an else without an if.
  • Using the assignment operator = instead of the relational equality operator == inside the brackets of an if statement: if(age=18) instead of if(age==18).

Day 5

  • Putting a semicolon after the closing parenthesis of a for statement for(…);{…}.
  • Effecting an endless loop through incrementing incorrectly or using a wrong condition in a for loop.

Day 6

  • Failing to nest for loops: Putting a for loop after another for loop ends instead of nesting the second within the first.

Day 7

  • Semicolon after parenthesis of a function name in a function definition.
  • %s instead of %c to print a single character in a string (that is in a character array).

Day 8

  • Forgetting to put a semicolon after the closing curly bracket of a structure definition.