This project demonstrates low-level file I/O in C using system calls like open
, read
, write
, and close
.
The program writes the ASCII codes for values 32–126 to a file, then reads them back, printing both the numeric values and their corresponding characters.
-
Generates a file containing ASCII codes (32–126).
-
Reads integers from the file and outputs:
- The numeric ASCII code
- The corresponding ASCII character
-
Implements file operations using system calls instead of standard library functions.
-
Includes error handling for file operations.
- C Programming Language
- POSIX System Calls (
open
,write
,read
,close
) - Linux/Unix environment
-
Clone this repository:
git clone https://github.com/yourusername/ascii-table-generator.git cd ascii-table-generator
-
Compile the program:
gcc c-ascii.c -o prog
-
Run the program with a filename as argument:
./prog DATA.txt
32
33 !
34 "
35 #
36 $
...
125 }
126 ~
This project reinforces:
- Working with low-level file I/O.
- Converting between numeric values and characters.
- Parsing integers manually from text data.
- Error handling in C.
- Allow users to specify custom ASCII ranges via command-line arguments.
- Support multiple output formats (decimal, hex, char).
- Option to write results to both file and terminal.
- David Salas C. Computer Science Student | Passionate about Systems Programming & Software Development