CC · Lesson 2 of 8
Variables & Data Types
C gives you direct control over data types and sizes. With great power comes the ability to cause extremely confusing bugs.
Variables in C must be declared before use. They are NOT initialized automatically — they contain whatever garbage was in that memory location. Always initialize your variables.
⚠ Warning
Reading an uninitialized variable is undefined behavior in C — the compiler is allowed to do literally anything, including generating code that does something completely unexpected. Always initialize your variables.
Reading an uninitialized variable is undefined behavior in C — the compiler is allowed to do literally anything, including generating code that does something completely unexpected. Always initialize your variables.