Course contentsShow
← C
Lesson 71 of 1,2191. FoundationsFree lesson

Common beginner typos

Common beginner typos

What you'll learn: How to identify and fix the most frequent punctuation and syntax slips that cause C compilers to complain.

In C, the compiler is like a very literal-minded chef. If a recipe says "Add a pinch of salt," and you accidentally write "Add a punch of salt," the chef won't just guess what you meant—they will stop the whole kitchen and demand a correction. Most errors you face as a beginner aren't logic flaws; they are simply "finger stutters."

The missing semicolon

Think of the semicolon (;) as the period at the end of a sentence. In English, if you forget a period, people can usually still read your paragraph. In C, the compiler treats your entire file as one giant, never-ending sentence until it hits a semicolon. If you forget one, the compiler gets confused and often reports an error on the next line, because that’s where it finally realized something was wrong.

Case sensitivity

To C, Main, main, and MAIN are three completely different things. Unlike some languages that are relaxed about capitalization, C is strictly case-sensitive. If you define a variable named score but try to print Score, the compiler will tell you that Score is "undeclared." It’s like calling a friend named "Bill" by the name "Will"—close doesn't count.

The "Equal" vs. "Assign" trap

This is the most famous typo in C. A single equals sign (=) is used to assign a value (e.g., "put the number 5 into this box"). A double equals sign (==) is used to compare two values (e.g., "is the number in this box equal to 5?"). Using one when you meant the other is a legal move that will often compile but make your program behave very strangely.

Spotting the slips

Here is a snippet showing these common hiccups in action:

#include <stdio.h>

int main() {
    int speed = 50; // Correct
    int Limit = 60; // Capital 'L'
    
    // ERROR: 'limit' is lowercase here, but was uppercase above
    // printf("%d", limit); 
    
    // ERROR: Missing semicolon at the end of this line
    // speed = 70 
    
    if (speed == 50) {
        printf("You are on pace.");
    }

    return 0;
}

Key takeaway

C is extremely picky about punctuation and capitalization; treat every semicolon and capital letter as a mandatory part of the "recipe."