Skip to content

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OS Language Grade Status

ft_printf

printf is a 42 school project whose goal is to recode the libc function printf.

How to use

  • Clone the repository
  • Run make to compile the library
  • Include the header file ft_printf.h in your project
  • Compile your project with the library libftprintf.a

Requirements

  • C compiler (clang or gcc)
  • Make

Mandatory part

  • The function must be named ft_printf.
  • The function must be prototyped as follows: int ft_printf(const char *, ...);
  • The function must not do the buffer management like the real printf.
  • Manage the following conversions: cspdiuxX%

Supported conversions

 %c Prints a single character.
 %s Prints a string of characters.
 %p Prints a pointer's address.
 %d  %i Prints a signed decimal integer.
 %u Prints an unsigned decimal integer.
 %x Prints a number in hexadecimal (lowercase).
 %X Prints a number in hexadecimal (uppercase).
 % Prints a percent sign.

Example

cc name_file.c libftprintf.a -o name_program #the name_program executable
#include "ft_printf.h"

int main(void)
{
    ft_printf("Hello, World!");
    return (0);
}

About

ft_printf is a project for the 42 school that requires implementing a custom printf function in C. The program must be able to handle various format specifiers such as %s, %d, %x, and so on. The project also requires a deep understanding of variable argument lists, memory allocation, and pointer manipulation in C.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages