A lightweight Numeral System Converter written in C that converts numbers from any base to any base. The project is designed to be simple, portable, and educational, demonstrating base conversion logic and modular C project structure.
-
Convert numbers between arbitrary numeral bases
-
Supports common bases:
- Binary (base 2)
- Octal (base 8)
- Decimal (base 10)
- Hexadecimal (base 16)
-
Written in pure C
-
Modular project structure (Src, Inc, Build)
-
Simple Makefile-based build system
.
├── Build / # Build output (generated)
├── Inc / # Header files
├── Src / # Source files
├── main.c
├── Makefile
└── README.md- GCC (or compatible C compiler)
- GNU Make
To compile the project, run:
makeThis will:
- Create the Build/ directory (if it does not exist)
- Compile all .c source files
- Generate the executable:
Build/main.oAfter building, run the program with:
./Build/main.o
[number] [format]- number – The input number. Its base is automatically detected using common prefixes.
- format – The desired output format.
The base of the input number is determined as follows:
| Prefix | Base | Example |
|---|---|---|
0b |
Binary | 0b1010 |
0x |
Hexadecimal | 0x1F |
0 |
Octal | 075 |
| none | Decimal | 42 |
To remove build files:
make cleanThis project is provided for educational and personal use. You may modify and distribute it freely.