/ft_printf42

building a simple printf

Primary LanguageC

ft_printf Project

Overview

This repository contains my implementation of the ft_printf project. The aim of the project is to recreate the C Standard Library function - printf(). This project helps to explore the concept of variadic functions in C and further enhances the understanding of data types, modifiers, and formatting output in C.

Requirements

The function is written in C language and thus needs the gcc compiler and some standard C libraries to run.

How to Use

  1. Clone this repository:
  2. git clone https://github.com/lpincoli/ft_printf42.git
  3. Go to the ft_printf directory:
  4. cd ft_printf42
  5. Run the Makefile to compile the library:
  6. make

    This will create a `libftprintf.a` library file.

  7. Now you can compile your project with this library.
  8. gcc main.c libftprintf.a -o output

Features

The ft_printf() function supports the following conversions:

  • %c : Prints a single character.
  • %s : Prints a string.
  • %p : Prints the void * pointer argument in hexadecimal format.
  • %d : Prints a decimal (base 10) number.
  • %i : Prints an integer in base 10.
  • %u : Prints an unsigned decimal (base 10) number.
  • %x : Prints a number in hexadecimal (base 16) lowercase format.
  • %X : Prints a number in hexadecimal (base 16) uppercase format.
  • %% : Prints a percent sign.

Subject

For more information about the project, read the subject file.

Enjoy using my ft_printf implementation! :)