Skip to content

This project implements a custom function, ft_printf, that mimics the behavior of the standard C library function printf. ft_printf takes a format string and optional arguments, formats the output based on specifiers within the format string, and prints the result.

Notifications You must be signed in to change notification settings

Alabar666/42-Printf_Markus42

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42cursus ft_printf()

Development repo for 42cursus ft_printf project



🗣️ About

_The aim of this project is to code a printf() function that will behave as close as possible from the original printf() from <stdio.h>


🧐 Great Resources for ft_printf()

42-Gitbook

C++ printf() reference

Oracle Docs

For detailed information, refer to the subject of the project

🚀 This project consists of recode the usetul printf() from <stdio.h> 
  • Supported conversions %: c, s, p, i, d, u, x, X
  • Supported flags: # + (space)
  • Supported options: - 0 . width

🛠️ Usage

Requirements

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

Instructions

make to compile.

Basic Usage

For example, let's create a main.c file.

// Include the header
#include "ft_printf.h"

int main(void)
{
      // Call the function
      ft_printf("Testing ft_printf!");
      return (0);
}

Compile the main.c file with the ft_printf library and run the program:

cc main.c libftprintf.a && ./a.out

Output should be:

Testing ft_printf!

Testing

WHY NOT ASSEMBLY?

++++++++++[>+>+++>+++++++>++++++++++<<<<-]>>>.>---.++++++++++++.++.+++ +++.--.<<++.>>------.------------.+++++++++++++.<<.>>++++++.------------ .-------. +++++++++++++++++++.<<.>>----------------.+++++.+++++++++.--- ----------.--.+ ++++++++++++++++.--------.+++++++++++++.<<.>>---------- -------------.+++.+++ ++++.---.----.+++++++++++++++++.--------------- --.-.<<.>>+++++.+++++.<<.>-------...

About

This project implements a custom function, ft_printf, that mimics the behavior of the standard C library function printf. ft_printf takes a format string and optional arguments, formats the output based on specifiers within the format string, and prints the result.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 96.2%
  • Makefile 3.8%