12345678910111213141516171819202122232425262728293031 |
- /* Assignment name : ft_putstr
- Expected files : ft_putstr.c
- Allowed functions: write
- --------------------------------------------------------------------------------
- Write a function that displays a string on the standard output.
- The pointer passed to the function contains the address of the string's first
- character.
- Your function must be declared as follows:
- void ft_putstr(char *str); */
- #include <unistd.h>
- void ft_putstr(char *str)
- {
- while (*str)
- {
- write(1, str, 1);
- str++;
- }
- }
- int main(void)
- {
- ft_putstr("Hello World");
- return (0);
- }
|