Skip to content

Welcome to the holberton-printf repository! This project is part of the curriculum at Holberton School and focuses on creating a custom implementation of the printf function in C. The goal is to replicate the standard functionality of printf while exploring the intricacies of string formatting and output generation.

Notifications You must be signed in to change notification settings

sachihiroo/holbertonschool-printf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Logo

holbertonschool-printf

Welcome to the holberton-printf repository! This project is part of the curriculum at Holberton School and focuses on creating a custom implementation of the _printf function in C. The goal is to replicate the standard functionality of _printf while exploring the intricacies of string formatting and output generation.

Project Overview

This project aims to implement a custom _printf function capable of handling various format specifiers such as characters, strings, integers, percentages, and even a custom %r specifier for reversing strings.

Features

  • Custom Format Specifiers: Extends the traditional _printf with additional custom format specifiers.
  • String Reversal: Introduces %r specifier for reversing strings, adding a unique touch to the standard functionality.
  • Modular Design: Codebase is organized into modular files for better maintainability and readability.

Project Files

  • main.h: Header file containing function prototypes.
  • _printf.c: Main implementation of the printf function.
  • get_fun.c: Additional helper functions.
  • num_print.c: handle the number.
  • ...

Project Requirements

  • Compiled on Ubuntu 14.04 LTS.
  • Programs and functions will be compiled with gcc 4.8.4 using the flags -Wall -Werror -Wextra -pedantic.
  • Follows the Betty style.
  • No use of global variables.
  • No more than 5 functions per file.
  • Prototypes of the functions are in the main.h header file.

Screenshot_2023-11-25_09_20_54

Usage

To use the _printf function in your program, include the main.h header file and link it with the compiled printf files.

#include "main.h"

int main(void)
{
    _printf("Hello, %s! The answer is %d.\n", "world", 42);
    return 0;

}

About

Welcome to the holberton-printf repository! This project is part of the curriculum at Holberton School and focuses on creating a custom implementation of the printf function in C. The goal is to replicate the standard functionality of printf while exploring the intricacies of string formatting and output generation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages