GithubHelp home page GithubHelp logo

uchihashaco / printf Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 304 KB

The ft_printf project is a C language implementation of the printf function. The printf function is used to format and print data to the console. The ft_printf implementation provides a way for C programmers to create formatted output for their programs.

Shell 1.41% C 93.96% Makefile 4.63%

printf's Introduction

ft_printf

Project Overview

The ft_printf project is a C language implementation of the printf function. The printf function is used to format and print data to the console. The ft_printf implementation provides a way for C programmers to create formatted output for their programs.

The ft_printf implementation includes support for several format specifiers, including:

  • %c: prints a single character
  • %s: prints a string
  • %d: prints a decimal integer
  • %u: prints an unsigned decimal integer
  • %x: prints a hexadecimal integer (lowercase)
  • %X: prints a hexadecimal integer (uppercase)
  • %p: prints a pointer address
  • The ft_printf implementation also includes support for various formatting options, such as field width and precision.

Project Structure

The ft_printf project is structured as follows:

libft: This folder contains a library of functions that are used by the ft_printf implementation. The library includes functions for memory management, string manipulation, and character manipulation, among other things.
ft_printf: This folder contains the implementation of the ft_printf function. The implementation is split into several files, each of which is responsible for a different part of the implementation.
Makefile: This file contains the build instructions for the project.

How to Use

To use the ft_printf implementation in your own C program, you must first compile the library using the Makefile. To do this, navigate to the root folder of the project in a terminal and type make.

Once the library has been compiled, you can include the ft_printf header file in your C program and call the ft_printf function as you would the printf function. For example:

#include "ft_printf.h"

int main(void)
{
ft_printf("Hello, world!\n");
return (0);
}

How to Test

The ft_printf implementation comes with a suite of test cases to ensure that it is working correctly. To run the test cases, navigate to the root folder of the project in a terminal and type make test.

The test suite includes tests for each of the format specifiers and various formatting options. The test results will be displayed in the terminal, indicating which tests have passed and which have failed.

Conclusion

The ft_printf project is a useful implementation of the printf function that provides C programmers with a way to format and print output to the console. The implementation includes support for several format specifiers and formatting options and is backed by a suite of test cases to ensure its correctness.

printf's People

Contributors

uchihashaco avatar

Stargazers

 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.