Giter Site home page Giter Site logo

ft_printf's Introduction

ft_printf

Description

ft_printf is a project from the 42 cursus that involves re-creating the C library function printf. The main objective is to understand the inner workings of this essential function, including variadic functions, format specifiers, and buffer management. The project requires implementing a custom ft_printf function that mimics the behavior of the standard printf.

Table of Contents

Requirements

To compile and run the project, you will need:

  • A Unix operating system (Linux or macOS).
  • gcc or any C compiler.
  • Make.

Installation

Clone the project repository and navigate to the main directory:

git clone https://github.com/PaLucena/ft_printf.git
cd ft_printf

Compile the project using the included Makefile:

make

This will generate the libftprintf.a library in the current directory.

Usage

To use the ft_printf function in your own project, include the libftprintf.a library and the corresponding header file:

#include "ft_printf.h"

Link the library during the compilation of your project:

gcc -o your_program your_program.c -L. -lftprintf

Supported Format Specifiers

The ft_printf function supports the following format specifiers:

  • %c: Character
  • %s: String
  • %p: Pointer
  • %d: Decimal integer
  • %i: Integer
  • %u: Unsigned integer
  • %x: Hexadecimal integer (lowercase)
  • %X: Hexadecimal integer (uppercase)
  • %%: Percent sign

Project Structure

The project is organized into the following files and directories:

  • src/: Contains the source code of the ft_printf implementation.
  • include/: Contains the header files.
  • Makefile: Build script to generate the library.
  • README.md: Project documentation.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

ft_printf's People

Contributors

palucena avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.