Some aspects of C that often trip up programmers:

  • Complex operator precedence rules - use parentheses liberally

  • Type casting can lead to unexpected behavior

  • switch statements “fall through” cases - add break statements

  • static means different things in local vs global scope

  • Common bugs:

    • Forgetting break statements in switch blocks
    • Mismatched pointer types in casts
    • Misunderstanding order of increment/decrement operators
    • Undefined behavior from numerical overflow or invalid memory access