Giter VIP home page Giter VIP logo

holbertonschool-printf's Introduction

_PRINTF

DESCRIPTION

The printf function allows its user to print a string of characters, a character or a number and many other things requested by the user on the terminal. Its syntax is generally printf("format", arg_1, arg_2, ..., arg_n);

format being the string of characters contained between the inverted commas ("") and arg_1, etc... being arguments for printing the string of characters.

In this project, we recreate the printf usually included in the standard <stdio.h> header with its requirements and constraints, using a number of different functions and tool functions to make it as complete as possible.

Here's a diagram showing how all the printf code reacts to a command being executed diagramme

REQUIREMENTS

  • Allowed editors: vi, vim, emacs
  • All your files will be compiled on Ubuntu 20.04 LTS using gcc
  • All your files should end with a new line
  • Your code should use the Betty style. It will be checked using betty-style.pl and betty-doc.pl
  • No more than 5 functions per file
  • The prototypes of all your functions should be included in your header file called main.h

CONTRIBUTING

  • Make a FORK of this directory

  • Make a git clone of this fork on your terminal

git clone (the link given with your github)
  • To compile all the data you can use this:
gcc -Wall -Werror -Wextra -pedantic -std=gnu89 -Wno-format *.c
  • Add your contributions (code or documents)

  • Commit and push

  • Wait for pull request to be merged

USE THE PROJECT

To test the program, you can use a main.c file containing different instructions. Include the given "main.h" in your header. In your instructions, start with a prototy of type

int main (void)

Then declare an int (in the examples below "len") which you initialise with the desired values.

len = _printf("Negative:[%d]\n", -762534);

Then use the printf command to display what you want:

_printf("%d\n", len);

And return (0) as it is an int

Examples:

#include "main.h"

int main (void)
{
    int len;

    len = _printf("Let's try to printf a simple sentence.\n");
    return (0);
}

Output : Let's try to printf a simple sentence.

or

#include "main.h"

int main (void)
{
    int len;
    
    len = _printf("Negative:[%d]\n", -762534);
    _printf("%d\n", len);
    return (0);
}

Output: -762534

You can use it to display your terminal according to the command you give it.

CREDITS

LICENCE

Copyright (C) <27/07/2023> copyright: T'Servrancx Olivier, Ruin Lucie

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of copyright: T'Servrancx Olivier, Ruin Lucie shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from copyright T'Servrancx Olivier, Ruin Lucie.

holbertonschool-printf's People

Contributors

electrikbox avatar lucieruin avatar

Watchers

 avatar

Forkers

lucieruin

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.