https://github.com/dpetrosy/42-printf
This project aims to code a custom implementation of the C printf function.
https://github.com/dpetrosy/42-printf
42 42-cursus 42-printf 42-school 42born2code 42cursus 42printf 42projects 42school 42yerevan c c-programming ft-printf library makefile printf printf-42 printf42
Last synced: 24 days ago
JSON representation
This project aims to code a custom implementation of the C printf function.
- Host: GitHub
- URL: https://github.com/dpetrosy/42-printf
- Owner: dpetrosy
- License: mit
- Created: 2024-01-25T15:12:14.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-03T13:21:24.000Z (about 1 year ago)
- Last Synced: 2025-03-24T13:45:17.615Z (about 1 month ago)
- Topics: 42, 42-cursus, 42-printf, 42-school, 42born2code, 42cursus, 42printf, 42projects, 42school, 42yerevan, c, c-programming, ft-printf, library, makefile, printf, printf-42, printf42
- Language: C
- Homepage:
- Size: 3.03 MB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
Printf Project
42 Yerevan Printf
For further information about 42cursus and its projects, please refer to 42cursus repo.
![]()
![]()
![]()
![]()
![]()
๐ About Project
ยท
๐ Supported Specifiers
ยท
๐จโ๐ป Usage
---
## ๐ About Project
> _This project is pretty straight-forward. You will implement your own printf. You will mainly learn how to use variadic arguments._
For detailed information, refer to the [**subject of this project**](README_files/printf_subject.pdf).
๐ TLDR: This project consists of coding a library that contains a simplified version
of the printf function.> [!NOTE]
> Because of 42 School norm requirements:
> * Each function can't have more than 25 lines of code.
> * All variables are declared and aligned at the top of each function.
> * Project should be created just with allowed functions otherwise it's cheating.## ๐ Supported Specifiers
These specifiers are supported by my printf implementation.
| Specifier | Short Description |
|:----------:|:---------------------------------------------------------:|
| %c | Print a single character. |
| %s | Print a string of characters. |
| %p | The void * pointer argument is printed in hexadecimal. |
| %d | Print a decimal (base 10) number. |
| %i | Print an integer in base 10. |
| %u | Print an unsigned decimal (base 10) number. |
| %x | Print a number in hexadecimal (base 16), with lowercase. |
| %X | Print a number in hexadecimal (base 16), with uppercase. |
| %% | Print a percent sign. |## ๐จโ๐ป Usage
### RequirementsThe library is written in C language and thus needs the **gcc compiler** and some standard **C libraries** to run.
### Instructions
**1. Compiling the library**
To compile the library, run:
```shell
$ cd path/to/printf && make
```**2. Using it in your code**
To use the library functions in your code, simply include its header:
```C
#include "ft_printf.h"
```
and, when compiling your code, add the required flags:```shell
-lftprintf -L path/to/libftprintf.a -I path/to/ft_printf.h
```