Giter VIP home page Giter VIP logo

lachlanstephen / ft_printf_42 Goto Github PK

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

My ft_printf project for the 42 Cursus. A recreation of the printf function found in the <stdio.h> C Library. Bonuses in progress. 100/100

Makefile 7.05% C 92.95%
42 42adelaide 42born2code 42cursus 42projects 42school c c-functions c-library ft-printf ft-printf-42 ft-printf42 function-library makefile norminette printf-42 printf42 variadic variadic-arguments variadic-function

ft_printf_42's Introduction

ft_printf

Mark: 100/100

Note: I'm currently working on the bonuses, so this repo wouldn't be able to be submitted as is.

ft_printf, one of three projects in Ring 1 of the 42 Cursus, introduced us to the idea of variadic functions: functions that take in a variable amount of arguments. Our task was to write a library that contains a recreation of printf from <stdio.h> in the Standard C Library.

Mandatory requirements:

  • Don't implement original printf buffer management
  • Handle the conversions cspdiuxX%
  • Output will be compared to original printf()

Bonus requirements:

  • Manage a combination of the flags -0. and field minimum width
  • Manage flags # + (one is a space)

Testing ft_printf functions

To test your own ft_printf, download main.c and testing_Makefile files from my repo, and move into your ft_printf project folder.

Run these commands to test your ft_printf functionality:

# Make using the specific Makefile with the -f flag

make re -f testing_Makefile

# Run compiled program

./test_printf

Compare the user output with the expected output.

Important: Make sure to run make fclean -f testing_Makefile to clean up files before submitting for evaluation.

To change the specifier my program tests:

  1. Edit the int main(void) function in main.c
  2. Comment out the currently active tests (with //)
  3. Uncomment desired test and recompile as above

Future Use of ft_printf

ft_printf can be added to your libft project folder to be used in future projects

Plan for repository

  • Complete bonus flag functionality
  • Create test function for bonus flags
  • Re-evaluate project with bonuses
  • Return whether diff of output is same or different from expected

ft_printf_42's People

Contributors

lachlanstephen 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.