C Programming Course / Variables, Initialization, and Constants

Course contents

Beginner

  1. C Programming: A Practical Overview
  2. Set Up a C Compiler and Build Loop
  3. Write and Run Your First C Program
  4. Understand C Program Structure
  5. C Data Types and Object Sizes
  6. Variables, Initialization, and Constants
  7. Operators, Expressions, and Conversions
  8. Read and Validate Console Input
  9. Make Decisions with if and switch
  10. Repeat Work with C Loops
  11. Create and Use C Functions
  12. Arrays and Bounds in C
  13. Multidimensional Arrays
  14. C Strings and Safe Formatting

Intermediate

  1. Bitwise Operators and Flags
  2. Scope, Lifetime, and Storage Duration
  3. Structures, Enumerations, and Unions
  4. typedef and Readable Type Names
  5. Pointers, Addresses, and Dereferencing
  6. Pointer Arithmetic and Array Traversal
  7. Function Pointers and Callbacks
  8. Recursion and Base Cases
  9. Dynamic Memory with malloc and free
  10. Headers, Includes, and the Preprocessor
  11. Header Files and Multi-File Programs
  12. Read and Write Files in C
  13. Command-Line Arguments
  14. Navigate the C Standard Library
  15. Error Handling with Return Values and errno
  16. Sorting and Searching with qsort and bsearch
  17. Compiler Warnings, Tests, and Debugging
  18. Build a Small Stack with an Array
  19. Linked Lists and Ownership

Advanced

  1. Declarations, Definitions, Scope, and Linkage
  2. Integer Promotions, Conversions, and Overflow
  3. const, volatile, restrict, and Aliasing
  4. Object Representation, Alignment, and Endianness
  5. Designated Initializers and Compound Literals
  6. Advanced Macros and Variadic Functions
  7. Threads, Atomics, and the C Memory Model
  8. Undefined, Unspecified, and Implementation-Defined Behavior
  9. C Standards, Compiler Modes, and Portability
  10. C23 Features and Migration Considerations
  11. Optional and Version-Specific C Features
  12. Performance Measurement and Optimization
  13. Secure C: Bounds, Ownership, and Input Boundaries

Expert

  1. Object Files, Linkers, and ABI Boundaries
  2. Static Analysis, Sanitizers, and Fuzz Testing
  3. Designing Stable and Testable C APIs
  4. Capstone: A Defensive Command-Line Record Tool

C Programming • C17 baseline, standards-specific features labeled

Variables, Initialization, and Constants

Initialize objects before reading them and use const to express values that should not be modified through a name.

A declaration gives an object a type and a name. Uninitialized automatic objects do not have a predictable value. Initialize them at declaration, and use const for inputs or configuration that a function should only read.

Example

#include <stdio.h>

int main(void) {
    const double tax_rate = 0.08;
    double subtotal = 25.00;
    double total = subtotal * (1.0 + tax_rate);

    printf("%.2f\n", total);
    return 0;
}

What to expect

27.00

Key idea: Initialization and const-qualified interfaces make data flow easier to review.