Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
I guess you can use it as is then. It's a custom function for printing output. Just copy the function definition where you want to use `ft_putchar`or `ft_putnbr`. Or even better, you can save the function definition in a header file, and include the header as necessary. BTW, I see a stranded character '0' in the end of `ft_putnbr` block, it may cause problem, so just delete that.
30th Jan 2020, 12:41 PM
Ipang
+ 1
Where did you find this `ft_putchar` ?
30th Jan 2020, 12:23 PM
Ipang
0
Well, if you look a little closer, the functions are named with the type of stuff they were meant to print. ft_putchar - prints a character. ft_putnbr - prints a number (integer to be precise). ft_putstr - prints a string (char array). ft_strdup - meant to duplicate a string (char array).
30th Jan 2020, 12:56 PM
Ipang
- 1
Perhaps you meant putchar? ft_putchar isn't part of the standard I/O IIRC. (Edit) Can you share the code please?
30th Jan 2020, 12:30 PM
Ipang
- 1
Just as you would normally, create a main function, and use either one of the `ft_*` functions for testing out. I thought you already have used them?
30th Jan 2020, 1:02 PM
Ipang