Skip to content

Shuvam-Banerji-Seal/C-Programming-for-Beginners

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<C/>
Complete C Programming Course

From Absolute Beginner to Advanced C Programmer

Website Stars License Issues

🌐 Interactive Website →  |  📚 Course Structure  |  ⚡ Online Code Editor


🚀 New! Check out the interactive website with a built-in C compiler playground — write, compile, and run C code directly in your browser!


Welcome to the Complete C Programming Course — a comprehensive, open-source journey from absolute beginner to advanced C programmer. This course covers everything from basic syntax to advanced topics like machine learning, network programming, and scientific simulations, all with a built-in browser code editor.

🌐 Interactive Website

The course features a full-featured interactive website that dynamically loads all content from this repository:

Feature Description Link
📚 Course Browser Browse all 20 modules with descriptions and code examples Modules page
⚡ Code Playground Write, compile, and run C code in your browser Playground
📖 File Documentation Every .c file has a companion .md with detailed explanations In each module detail page
🔍 Code Viewer View any source file with syntax highlighting, expand to see full code Click any file card
🎨 Dark/Light Theme Coffee-toned dark theme with warm green accents Click the theme toggle
🚀 Instant Deploy GitHub Actions auto-deploys on every push View workflow

How Content Loading Works

The website fetches content directly from this GitHub repository using:

  • README files → Rendered as module descriptions with full markdown support
  • .md companion files → Each .c/.h file has a .md file with detailed explanations, function documentation, compilation instructions, and usage notes
  • Source code → Displayed with syntax highlighting and a one-click "Edit & Run" button that loads the code into the playground editor
  • GitHub API → Repository stats (stars, forks) displayed on the About page

Online C Compiler

The Code Playground features:

  • CodeMirror editor with C syntax highlighting, auto-closing brackets, line numbers, and foldable code
  • Multi-file tabs — load multiple source files and switch between them
  • Compiler Explorer backend — compiles and executes your C code using GCC 13.2 or Clang 17
  • Compiler flags — choose optimization levels (-O0 through -O3)
  • localStorage persistence — your code and open tabs are saved automatically
  • Output panel — shows stdout, stderr, compilation warnings/errors, and exit codes
  • Copy output button for sharing results

Note: The online compiler is powered by Compiler Explorer. For full control, compile locally with GCC or Clang using the provided Makefiles.

Course Overview

This course is structured into 20 modules, each building upon the previous one. Whether you're a complete beginner or looking to master advanced C programming, this course has something for you.

Course Structure

Beginner Level (Modules 1-5)

  • Introduction to C Programming
  • Setting Up Your Development Environment
  • Your First C Program (Hello World)
  • Understanding Compilation Process
  • Basic Input/Output
  • Variables and Constants
  • Primitive Data Types (int, float, char, double)
  • Type Conversion and Casting
  • Operators (Arithmetic, Relational, Logical, Bitwise)
  • Pre/Post Increment and Decrement
  • Conditional Statements (if, else, else-if)
  • Switch Statement
  • Loops (for, while, do-while)
  • Break and Continue
  • Nested Loops and Loop Performance
  • Function Declaration and Definition
  • Function Parameters and Return Types
  • Scope and Lifetime
  • Recursion
  • Function Pointers
  • One-Dimensional Arrays
  • Multi-Dimensional Arrays
  • Character Arrays and Strings
  • String Manipulation without string.h
  • Common String Operations

Intermediate Level (Modules 6-10)

  • Introduction to Pointers
  • Pointer Arithmetic
  • Pointers and Arrays
  • Pointer to Pointer
  • Pointers and Functions
  • Stack vs Heap Memory
  • Dynamic Memory Allocation (malloc, calloc, realloc, free)
  • Memory Leaks and Debugging
  • Custom Memory Allocators
  • Memory Management Best Practices
  • Defining Structures
  • Nested Structures
  • Arrays of Structures
  • Pointers to Structures
  • Unions and Bit Fields
  • typedef and enum
  • File Handling Basics
  • Reading and Writing Text Files
  • Binary File Operations
  • File Positioning
  • Error Handling in File Operations
  • Preprocessor Directives
  • Macros and Macro Functions
  • Conditional Compilation
  • Header Guards
  • Common Preprocessor Tricks

Advanced Level (Modules 11-15)

  • Linked Lists (Singly, Doubly, Circular)
  • Stacks and Queues
  • Hash Tables
  • Implementation and Complexity Analysis
  • Visualization with Mermaid Diagrams
  • Binary Trees and Binary Search Trees
  • AVL Trees and Red-Black Trees
  • Heaps and Priority Queues
  • Graphs (Representation and Traversal)
  • Tries and Suffix Trees
  • Complete DSA with Visual Diagrams
  • Introduction to GDB
  • Setting Breakpoints
  • Stepping Through Code
  • Examining Variables and Memory
  • Advanced GDB Techniques
  • Debugging Memory Issues
  • Introduction to GTK4
  • Setting Up GTK4 Development
  • Creating Windows and Widgets
  • Event Handling
  • Building a Simple GUI Application
  • GTK4 Best Practices
  • Console-Based Tic-Tac-Toe
  • Snake Game
  • Sudoku Solver
  • Simple Platformer Basics
  • Game Loop and State Management

Expert Level (Modules 16-20)

  • Socket Programming Basics
  • TCP/IP Communication
  • UDP Programming
  • HTTP Client/Server Implementation
  • Multi-threaded Servers
  • Network Protocol Implementation
  • Introduction to ML Concepts
  • Perceptron Implementation
  • Simple Neural Networks from Scratch
  • Activation Functions
  • Forward and Backward Propagation
  • Training Neural Networks
  • Understanding MNIST Dataset
  • Image Processing in C
  • Building a Digit Recognizer
  • Training and Testing
  • Optimization Techniques
  • Complete Working Project
  • Numerical Methods
  • Matrix Operations
  • Molecular Dynamics Simulations
  • Physics Simulations
  • Data Visualization
  • Performance Optimization
  • Build Systems (Make, CMake)
  • Unit Testing in C
  • Code Style and Standards
  • Version Control Best Practices
  • Profiling and Optimization
  • Writing Maintainable Code

Learning Path

For Complete Beginners

Start with Module 01 and work through Modules 1-5 sequentially. Take your time with each concept.

For Those with Basic Programming Knowledge

You might skim Modules 1-3 and focus more on Modules 4-10.

For Intermediate Programmers

Jump to Modules 6-15, focusing on areas where you need improvement.

For Advanced Learners

Modules 16-20 provide cutting-edge applications of C programming.

How to Use This Course

  1. Read the Theory: Each module starts with conceptual explanations
  2. Study the Examples: Carefully examine the provided code examples
  3. Compile and Run: Use the provided Makefiles to compile examples
  4. Learn from Bugs: Study the buggy examples to understand common mistakes
  5. Practice: Complete the exercises at the end of each section
  6. Build Projects: Apply your knowledge in the projects
  7. Review: Revisit difficult concepts and practice more

Prerequisites

  • A computer (Windows, macOS, or Linux)
  • A C compiler (GCC or Clang - both supported)
  • A text editor or IDE (VS Code, CLion, Vim, etc.)
  • Basic command-line knowledge
  • Enthusiasm to learn!

Compilation Quick Start

Each module includes a Makefile for easy compilation:

# Navigate to any module
cd 03-control-flow

# Compile all programs
make

# Run programs
./conditionals
./loops
./switch_demo

# Clean up compiled files
make clean

# Use Clang instead of GCC
make CC=clang

For detailed compilation instructions, see COMPILATION_GUIDE.md

Available Make Targets

Most modules support these targets:

  • make - Compile all programs
  • make clean - Remove compiled files
  • make run - Compile and run all programs
  • make run-buggy - Run buggy examples (educational)
  • make debug - Compile with debug symbols
  • make asan - Compile with AddressSanitizer (memory error detection)

Example Compilation

# Module 03: Control Flow
cd 03-control-flow
make # Compile with GCC
make CC=clang # Compile with Clang
make run # Run all correct examples
make run-buggy # Run buggy examples

# Module 06: Pointers
cd ../06-pointers
make asan # Compile with memory sanitizer
./pointer_basics

# Module 07: Memory Management
cd ../07-memory-management
make valgrind # Run with Valgrind (if installed)

Features

  • Progressive Learning: Concepts build upon each other logically
  • Visual Aids: Mermaid diagrams for data structures and algorithms
  • Hands-on Projects: Real-world applications in every advanced module
  • Best Practices: Learn industry-standard coding practices
  • Complete Examples: Every concept is demonstrated with working code
  • Buggy Examples: Learn from deliberately wrong code with explanations
  • Compilation Guide: Comprehensive guide for GCC and Clang with all flags explained
  • Makefiles: Each module includes a Makefile with detailed flag documentation
  • Memory Safety: Examples include sanitizers for detecting memory errors
  • Exercises: Reinforce learning with practical problems

Supplementary Materials

Fundamentals

The fundamentals directory contains additional beginner-friendly examples, including an error handling and defensive programming module covering errno, return codes, input validation, and safe coding patterns.

Reference Notes (LaTeX)

The notes directory provides LaTeX reference notes for each module. Build them to PDF with make inside the notes/ directory, or compile individually with pdflatex module-XX.tex. See notes/README.md for details.

Developer Documentation

Additional Resources

  • Makefiles: Each module has a Makefile with detailed comments
  • Buggy Code: Learn from common mistakes with *_buggy.c files
  • Cheat Sheets: Quick reference guides in each module
  • Common Pitfalls: Learn from common mistakes

Contributing

This is an educational resource. If you find errors or want to suggest improvements, please see the Contributing Guide for instructions.

License

This course is released under the MIT License. See LICENSE for details.

Getting Started

Ready to begin? Head over to Module 01: Getting Started with C and start your journey!


Topics & Tags

C Programming Learn C C Tutorial Programming Course C Language Pointers Memory Management Data Structures Algorithms Embedded Systems Systems Programming GCC Clang Makefile GDB Debugging GTK4 Network Programming Machine Learning Scientific Computing Open Source MIT License C for Beginners Advanced C Computer Science


Happy Coding! 🚀


Remember: The best way to learn programming is by doing. Don't just read the code—type it out, modify it, break it, and fix it. That's how you truly learn!

About

Complete C Programming Course: 20 modules from beginner to advanced. Learn C with interactive examples, buggy code analysis, Makefiles, GDB debugging, data structures, networking, ML & scientific computing. Includes browser-based code editor.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors