Skip to content

BadhonPain/Sea_Of_C

Repository files navigation

Typing SVG
Visitor Count

Sea of C — Programming Journey

Language C Compiler GCC IDEs


"The only way to learn a new programming language is by writing programs in it."Dennis Ritchie

Welcome to the digital archive of my C programming journey! This repository contains a structured, modular log of my 1st-semester coding progress, ranging from the fundamental printf("Hello, World!"); to advanced system concepts like memory management, file handling, and custom macros.

This project has been restructured to offer a clean, educational roadmap for anyone exploring the foundations of computer science and C systems programming.


🗺️ Curriculum Roadmap

The codebase is organized chronologically and conceptually into 11 modules:

Sea of C/
│
├── 01_Introduction/                          # First C Program & Structure
├── 02_Data_Types_Operators/                  # Variables, Operators, Precedence
├── 03_Control_Flow/                          # Conditionals, Loops, & Pattern Printing
├── 04_Functions/                             # Scope, Modular Code, & Recursion
├── 05_Arrays_and_Strings/                    # 1D/2D Arrays, Sorting, & Safe String Handling
├── 06_Pointers/                              # Addresses, Pointer Arithmetic, & Void/Dangling Pointers
├── 07_Structures_Unions_Enums/               # Custom Structs, Unions, & Enum Types
├── 08_Dynamic_Memory_Allocation/             # Heap Allocation (malloc, calloc, realloc, free)
├── 09_File_Handling/                         # File I/O Operations (Text & Binary)
├── 10_Preprocessors_and_Macros/              # Preprocessors, Macros, Header Guards, & CLA
└── 11_Mini_Projects/                         # Interactive Console Games

📁 Repository Breakdown

  • Concepts: Decision making (if, else if, switch-case, ternary operator) and iterative execution (for, while, do-while, nested loops).
  • Sub-folders:
    • branching/: Conditionals and calculators. Theory: Branching Basics.
    • loops/: Loop syntax, input validation, digit sum, and loop exercises.
    • pattern_printing/: Multi-loop grid printing, star/number triangles, and diamond grids.
  • Concepts: Continuous memory storage, array traversal, Selection Sort, string manipulation, and safe buffer handling.
  • Sub-folders:
    • arrays/: 1D & 2D arrays, finding min/max, duplicates tracking, reversing arrays, and sorting.
    • strings/: Safe input handling via fgets() (avoiding buffer overflows), string library functions (strlen, strcpy, strcat, strcmp).
  • Concepts: Stream files, character/string I/O (fgetc, fputc, fgets, fputs), block binary I/O (fread, fwrite), and EOF marker detection.
  • Core Files:
  • Data: All read/write files are stored inside the centralized /data directory.
  • Guess the Number:
    • Path: guess_the_number.c
    • Rules: The computer selects a random number, and the player tries to guess it. The game records the number of attempts and gives hints ("higher" or "lower").
  • Snake Water Gun (Rock Paper Scissors Variant):
    • Path: snake_water_gun.c
    • Rules: An interactive round-based game played against the computer. Evaluates choices (Snake beats Water, Water beats Gun, Gun beats Snake) and counts scores.

🛠️ How to Compile & Run

To compile any program in this repository, make sure you have gcc (MinGW for Windows) installed.

1. Terminal / Command Prompt

Open a terminal in the folder containing the source file and run:

# Compile
gcc program_name.c -o program_name.exe

# Run
./program_name.exe

2. VS Code Setup

  1. Install the C/C++ extension by Microsoft.
  2. Open the directory in VS Code.
  3. Use Ctrl + Shift + B to build, or run using the terminal.

3. Code::Blocks Setup

  1. Open Code::Blocks.
  2. Select File -> Open... and select the .c file.
  3. Click the Build and Run button (or press F9).

📚 Acknowledgements & References

  • Badhon Pain — Repository owner and Maintainer.
  • "The C Programming Language" (K&R) by Brian W. Kernighan and Dennis M. Ritchie — served as the foundational textbook guide for learning standard C programming practices, concepts, and conventions.
  • Prof. Dr. AKM Ashikur Rahman (Department of CSE, BUET) — who instructed our class and whose lectures and course slides provided the core curriculum, educational framework, and structured examples followed throughout this journey.

About

A structured digital archive of my C programming journey. Contains modular code examples, theory notes, and practice problem sets covering core topics: variables, pointers, dynamic memory allocation (heap), structures, unions, file handling, preprocessor macros, and interactive console games

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages