Skip to content

itachi-re/c-learning-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🧠 C Programming Notes

A comprehensive collection of notes, code snippets, and hands-on projects documenting my journey through the C programming language.

Language License


📚 Overview

This repository serves as a structured learning resource for C programming fundamentals and advanced concepts. Each section includes detailed explanations, practical examples, and exercises to reinforce understanding.

🗂️ Repository Structure

├── 00_index.md          # Complete table of contents
├── 01_basics.md         # Syntax, variables, and data types
├── 02_pointers.md       # Pointers, arrays, and memory management
├── 03_functions.md      # Function declarations, definitions, and scope
├── 04_structs.md        # Structures and unions
├── 05_file_io.md        # File handling and I/O operations
├── 06_preprocessor.md   # Macros, conditional compilation, and header files
├── 07_dynamic_memory.md # malloc, calloc, realloc, and free
├── 08_data_structures.md # Linked lists, stacks, queues, and trees
├── 09_algorithms.md     # Sorting, searching, and algorithm analysis
├── 10_advanced.md       # Bitwise operations, function pointers, variadic functions
└── projects/            # Hands-on demo programs and applications

📖 Content Breakdown

01. Basics

  • Syntax fundamentals – Understanding C program structure
  • Variables & Data Types – Integers, floats, chars, and type conversions
  • Control Flow – Conditionals (if/else, switch) and loops (for, while, do-while)
  • Operators – Arithmetic, logical, relational, and assignment operators

02. Pointers & Memory

  • Pointer Fundamentals – Declaration, dereferencing, and pointer arithmetic
  • Arrays – Static and dynamic arrays with pointers
  • Memory Management – Stack vs heap, understanding memory layout

03. Functions

  • Function Declaration & Definition – Prototypes and implementations
  • Parameter Passing – Pass by value vs pass by reference
  • Scope & Lifetime – Local, global, and static variables
  • Recursion – Recursive functions and stack frames

04. Structures & Unions

  • Struct Basics – Defining and using structures
  • Nested Structures – Structures within structures
  • Unions – Memory-efficient data structures
  • Typedef – Creating custom type names

05. File I/O

  • File Operations – fopen, fclose, fread, fwrite
  • Text vs Binary Files – Different file handling modes
  • Error Handling – Checking file operations for errors
  • Command Line Arguments – argc and argv

06. Preprocessor

  • Macros – #define and function-like macros
  • Conditional Compilation – #ifdef, #ifndef, #if
  • Header Files – Creating and using .h files
  • Include Guards – Preventing multiple inclusions

07. Dynamic Memory

  • Memory Allocation – malloc, calloc, realloc
  • Memory Deallocation – free and avoiding memory leaks
  • Memory Debugging – Using tools like valgrind
  • Common Pitfalls – Dangling pointers, double free, buffer overflows

08. Data Structures

  • Linked Lists – Singly and doubly linked lists
  • Stacks & Queues – LIFO and FIFO implementations
  • Trees – Binary trees and binary search trees
  • Hash Tables – Hash functions and collision handling

09. Algorithms

  • Sorting – Bubble sort, insertion sort, quicksort, merge sort
  • Searching – Linear search, binary search
  • Time Complexity – Big O notation and analysis
  • Space Complexity – Memory usage considerations

10. Advanced Topics

  • Bitwise Operations – Bit manipulation and flags
  • Function Pointers – Callbacks and function tables
  • Variadic Functions – Functions with variable arguments
  • Multi-file Projects – Compiling and linking multiple files

Projects

Real-world applications demonstrating concepts:

  • Simple calculators
  • File I/O utilities
  • Data structure implementations
  • And more...

🚀 Getting Started

Prerequisites

  • GCC compiler or any C compiler
  • Text editor or IDE (VS Code, CLion, etc.)
  • Basic command line knowledge

Running Examples

# Clone the repository
git clone https://github.com/itachi-re/c-programming-notes.git

# Navigate to project directory
cd c-programming-notes/projects

# Compile and run
gcc example.c -o example
./example

🎯 Learning Goals

  • Master C syntax and fundamentals
  • Understand memory management and pointers
  • Write and debug functions effectively
  • Work with structures and custom data types
  • Handle file I/O operations
  • Implement common data structures
  • Master dynamic memory allocation
  • Understand and use the preprocessor
  • Implement sorting and searching algorithms
  • Learn advanced topics (bitwise ops, function pointers)
  • Build complete multi-file C projects

🤝 Contributing

Contributions, corrections, and suggestions are welcome! Feel free to:

  • Open an issue for discussion
  • Submit a pull request with improvements
  • Share additional resources

📝 Notes

All documentation is written in Markdown for easy reading and portability. The repository is version-controlled with Git to track learning progress over time.

📧 Contact

Questions or feedback? Feel free to reach out!

📬 Email: itachi_re@protonmail.com


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Star this repo if you find it helpful for your C learning journey!

About

notes and scripts while learning c

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages