Skip to content

Ibsofttech/printf

Repository files navigation

printf Project

Description

This is a team project, and is part of ALX first year curriculum. The main task is to replicate the C standard library printf() function.

Printf function produces output depending on the variable types and the format of output you want it to produce. These includes:

  • • %c: Prints a single character.
  • • %s: Prints a string of characters.
  • • %d: Prints integers.
  • • %i: Prints integers.
  • • %b: Prints the binary representation of an unsigned decimal.
  • • %u: Prints unsigned integers
  • • %X: Prints the hexadecimal representation of an unsigned decimal in uppercase letters
  • • %r: Prints a reversed string

Prototype

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

##Usage

  • • Prints a string to the standard output, according to a given format
  • • All files were created and compiled on Ubuntu 14.04.4 LTS using GCC 4.8.4 with the command gcc -Wall -Werror -Wextra -pedantic *.c
  • • Call it this way: _printf("format string", arguments...) where format string can contain conversion specifiers and flags, along with regular characters

Examples

  • • _printf("Hello, main\n") prints "Hello, Main", followed by a new line
  • • _printf("%s", "Hello") prints "Hello"
  • • _printf("This is a number: %d", 98) prints "This is a number: 98"

PROJECT DONE BY: MUIBI IBRAHIM KAYODE [email protected]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages