Skip to content

An educational C program highlighting HEAP usage & how to free the memory after usage.

License

Notifications You must be signed in to change notification settings

FatherDivine/theHEAPHotel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🏨 theHEAPHotel - A C Programming Project

C PRs Welcome

An educational C program highlighting heap usage & how to free the memory after usage.

Table of Contents

Description

The HEAP Hotel project is designed to demonstrate a simple C programming project. It specificially highlights using the heap and freeing memory after its usage.

Definition:

In C programming, the Heap (not an acronym, just a name for a "pile" of memory) is a region of your computer's RAM used for dynamic memory allocation.

Unlike the Stack, which handles local variables automatically, the Heap is a "free-for-all" area where you, the programmer, manually request and release memory during the execution of a program.

Demo/Screenshots

Main Menui Check-out

Features

  • 📚 Code Quality: The project is written in clean, readable C code, following best practices for coding standards.
  • 🛠️ Modular Design: The project is structured into a single, self-contained C file, making it easy to understand and maintain.
  • 📊 Performance: The project is optimized for performance, leveraging the efficiency of the C language.

Tech Stack

  • C programming language
  • No frameworks or libraries are used in this project.

Project Structure

theHEAPHotel/
├── theHEAPHotel.c              # Source code
└── screenshots/                # Screenshots folder
    ├── theHEAPHotel1.png
    └── theHEAPHotel2.png

Prerequisites

  • A C compiler (e.g., GCC) installed on the system.
  • A basic understanding of C programming concepts.

Installation

To install the project, follow these steps:

git clone <repository-url>
cd theHEAPHotel

No additional installation steps are required, as the project consists of a single C file.

Usage

To compile and run the project, use the following commands:

gcc theHEAPHotel.c -o theHEAPHotel
./theHEAPHotel

Replace <repository-url> with the actual URL of the repository.

Contributing

Contributions are welcome and appreciated. To contribute, please fork the repository, make your changes, and submit a pull request. Ensure that your code follows the same coding standards and best practices as the existing codebase.

License

The theHEAPHotel project is licensed under the MIT License. See the LICENSE file for details.

Notes

Great tools I learned about along the way to help C coders:

Tool Purpose When to use it
Valgrind Memory Leaks When you suspect malloc isn't being free'd (or heap/stack in general).
GDB Logic Debugging When your code runs but gives the wrong math.
Cppcheck Bug Hunting Before you even run the code.
ASan Memory Crashes To find exactly where a "Segfault" happened.
Flawfinder Vulnerability Scanner Scans code for CWE (Common Weakness Enumerations).

About

An educational C program highlighting HEAP usage & how to free the memory after usage.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages