Git Product home page Git Product logo

printf's Introduction

🖨️ Prinft

badge

anlima's 42 ft_printf Score

GitHub Language Count GitHub Top Language GitHub Contributors GitHub Last Commit wakatime

libftprintf.a is a custom library that provides a function called ft_printf, which mimics the behavior of the standard printf function from the C library. This library allows you to format and print output to the standard output stream, similar to printf.

✨ Features

  • Supports various format specifiers, including c, s, p, d, i, u, x, X, and %
  • Handles basic conversions and formatting options
  • Allows printing of characters, strings, pointers, decimal and integer numbers, and hexadecimal numbers
  • Can handle both lowercase and uppercase hexadecimal formatting
  • Provides a convenient way to output formatted text

🚀 Usage

To use the ft_printf function in your C program, follow these steps:

  1. Include the "libftprintf.h" header file in your source code.
  2. Compile your program with the libftprintf.a library using the provided Makefile.
  3. Call ft_printf function with a format string and any additional arguments.

Here's an example of how to use ft_printf:

#include "libftprintf.h"

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

	return (0);
}

In the above example, ft_printf is used to print a string and an integer value. The format specifier %s is used for the string, and %d is used for the integer.

⚙️ Compilation

To compile your program with the libftprintf.a library, use the provided Makefile. The Makefile includes the following commands:

  • make all: Compiles your program and creates the libftprintf.a library.
  • make clean: Removes object files generated during compilation.
  • make fclean: Removes the libftprintf.a library and object files.
  • make re: Performs a clean build by running make fclean followed by make all.

Note: This library is for educational purposes and serves as a learning experience in re-implementing a simplified version of the printf function. It may not cover all the advanced features and edge cases present in the standard printf function.

printf's People

Contributors

angelamcosta avatar

Stargazers

 avatar  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.