Git Product home page Git Product logo

printf's Introduction

_printf

_printf is a re-implementation of the standard C library function printf. It provides a way to format and print data, similar to printf.

Usage

int _printf(const char *format, ...);

The _printf function takes in a format string, followed by any additional arguments specified in the format string. The format string consists of regular characters, which are simply printed, and conversion specifiers, which are replaced by the values of the corresponding arguments.

Conversion Specifiers

The following conversion specifiers are currently supported by _printf:

formatter Description
%c Prints a single character.
%s Prints a string of characters.
%d Prints an integer (decimal).
%i Prints an integer (decimal).
%b Prints a binary number.
%u Prints an unsigned integer.
%o Prints an octal number.
%x Prints a hexadecimal number (lowercase).
%X Prints a hexadecimal number (uppercase).
%r Prints a string in reverse.
%R Prints a string in rot13 encryption.

Example

_printf("Hello, %s!\n", "world");

This will output:

Hello, world!

Limitations

  • _printf does not support all the format specifiers of the standard printf function.
  • _printf does not support floating point numbers.
  • _printf does not support the width and precision field of the format specifiers.
  • _printf does not handle invalid format strings or conversion specifiers.

Additional Information

  • _printf is not intended to be a full replacement for printf, but rather a demonstration of how the printf function can be implemented.
  • The implementation of _printf may differ from the implementation of printf in the standard C library.

Contributing

If you would like to contribute to the development of _printf, please feel free to submit pull requests or issues on the GitHub repository.

Attribution

_printf function was created by @androidmini9x & @souadhelmy as a project for Alx School.

printf's People

Contributors

souadhelmy avatar

Watchers

Android Mini 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.