A Custom implementation of the printf function in C
ft_printf
is a custom implementation of the standard C library function printf
. This project is part of the Hive Helsinki curriculum.
The printf
function is a common standard library function used in C for formatted output. The goal of this project is to recreate printf
function to gain a deeper understanding of data types, variadic functions, and string manipulation in C.
This project serves as a solid foundation for understanding how to handle and format different types of data in C. It is a great exercise for learning about variadic functions and the intricacies of data formatting.
This project was completed as a solo project.
- Clone the repository:
git clone https://github.com/username/ft_printf.git
- Navigate into the project directory:
cd ft_printf
- Compile the project:
make
After compiling the project, you can use the ft_printf
function in the same way you would use the standard printf
function.
#include "ft_printf.h"
int main(void)
{
ft_printf("Hello, %s!", "world");
return (0);
}
The ft_printf
project was evaluated based on the following criteria:
-
Code Quality: The code must be clear, concise, and efficient. It should be well-organized and easy to read. The use of global variables is forbidden and the project must conform to the school's norminette rules.
-
Functionality: The
ft_printf
function must work correctly and handle all format specifiers and flags of the realprintf
. The library should not have any memory leaks. -
Compiling: The library must compile without any errors or warnings. The project should compile with the
-Wall -Wextra -Werror
flags. -
Makefile: The project should include a Makefile that compiles the library and includes rules like
all
,clean
,fclean
, andre
. The Makefile should recompile only the necessary files when a change is made.
Here are some of the comments received during the peer evaluation of the libft
project:
Peer 1: "Lumi did a great work with her printf. All her functions are smart and efficient, her code is very clean and well organized. She also showed a good understanding of subject. Well done and good luck with evaluations :)"
Peer 2: "Lumi had nice and clean printf implementation. We ran some tests and went trough the code, everything worked perfectly and there were no norm errors or other issues. Once again it was interesting to see different ways to implement the conversions. Nice job Lumi! Good luck for the last evaluation!"
Peer 3: "Lumi did a great job! We went tru function, it was written very clear and easy to read. Lumi was able to explain all her functions very well. Was happy t meet you, and keep coding! "
This project is licensed under the MIT License - see the LICENSE file for details.