GithubHelp home page GithubHelp logo

printf's Introduction

#Fiati & Hamza team project "printf"

  1. File: _printf.c This file contains the implementation of the _printf function, which serves as the entry point for the custom printf implementation. It takes a format string and variable arguments, similar to the standard printf function, and returns the number of characters printed. It iterates over the format string, checking for format specifiers starting with '%' and calling the appropriate function to handle each specifier.

  2. File: function.c This file contains the implementation of the _function function. This function is responsible for selecting the appropriate function based on the format specifier. It uses an array of print_function_t structures to map each specifier to its corresponding print function. If a matching specifier is found, the associated function is called with the variable argument list.

  3. File: get_digits.c This file contains the implementation of the print_decimal function, which handles the printing of decimal digits. It takes a variable argument list and retrieves an integer argument. It then converts the integer into its decimal representation by dividing it by powers of 10 and extracting the digits one by one. The digits are printed using the _putchar function, and the count of characters printed is returned.

  4. File: get_string.c This file contains the implementation of the print_strings function, which handles the printing of strings. It takes a variable argument list and retrieves a string argument. If the string is NULL, it is set to "(null)". The function then iterates over each character in the string and prints it using the _putchar function. The count of characters printed is !

  5. File: main.h This header file contains function prototypes, typedefs, and the print_function_t structure definition used in the other source files. It also includes the necessary standard library headers and the stdarg.h header for variable argument handling.

  6. File: get_characters.c This file contains the implementation of the print_characters function, which handles the printing of single characters. It takes a variable argument list and retrieves an integer argument representing the character. The function simply calls the _putchar function to print the character, and always returns 1.

printf's People

Contributors

mrfiati avatar roxxe34 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

roxxe34

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.