ft_printf is a project that challenges you to implement your version of the standard C library function printf. This project is part of the Common Core curriculum at 42 Porto School.
The ft_printf project tasks you with recreating the behavior of the standard C library function printf. This function allows for formatted output, where you can specify various format specifiers to control the display of data.
- Clone the repository:
git clone https://github.com/Kelho0812/ft_printf.git
cd ft_printf- Build the project:
makeTo use ft_printf, include the ft_printf.h header file in your project. Call the function with the desired format string and additional arguments.
Example:
#include "ft_printf.h"
int main(void)
{
ft_printf("Hello, %s! The answer is %d.\n", "World", 42);
return (0);
}The following format specifiers are supported in ft_printf:
%c: Character%s: String%p: Pointer%dor%i: Signed integer%u: Unsigned integer%x: Hexadecimal (lowercase)%X: Hexadecimal (uppercase)%%: Percent sign
#include "ft_printf.h"
int main(void)
{
int value = 42;
char *str = "World";
ft_printf("Hello, %s! The answer is %d.\n", str, value);
return (0);
}This will output:
Hello, World! The answer is 42.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.