Git Product home page Git Product logo

printf's Introduction

0x11. C - printf

Low-level programming & Algorithms

Authors: Juan Pablo Gaviria and Juan Jose Carabali

Based on the "Secrets of printf" scientific paper by Professor Don Colton

Requirements

  • Authorized functions and macros:

    • write (man 2 write)
    • malloc (man 3 malloc)
    • free (man 3 free)
    • va_start (man 3 va_start)
    • va_end (man 3 va_end)
    • va_copy (man 3 va_copy)
    • va_arg (man 3 va_arg)
  • If the task does not specify what to do with an edge case, do the same as printf

  • The main.c file is shown as example and for the test purpose

Style guides

  • Allowed editors: vi, vim, emacs
  • All files should end with a new line
  • The code should use the Betty style
  • Global variables are not allowed
  • No more than 5 functions per file

Headers

  • The prototypes of all functions should be included in header file called holberton.h
  • All header files should be include guarded

Compilation

  • All files will be compiled on Ubuntu 14.04 LTS
  • Programs and functions will be compiled with gcc 4.8.4 using the flags -Wall -Werror -Wextra and -pedantic
  • code will be compiled this way: gcc -Wall -Werror -Wextra -pedantic *.c

Tests

  • The main.c file with tests contains all the tests
  • The main.c file is commited under the test folder
  • To make it work:
    • Make a symbolic link to the test/main.c file to the root of the project: ln -s test/main.c .
    • Compile project with -Wno-format extra flag: gcc -Wall -Werror -Wextra -pedantic -Wno-format *.c
    • Do not push any .c file containting a main function in the root directory of the project

Examples

  • %d

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.