-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putendl.c
36 lines (32 loc) · 1.2 KB
/
ft_putendl.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putendl.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lsauvage <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/11/24 12:30:24 by lsauvage #+# #+# */
/* Updated: 2017/11/24 15:40:08 by lsauvage ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
** DESCRIPTION : Affiche la chaine s sur la sortie standard suivi d'un '\n'
**
** PARAM #1 : La chaine de caracteres a afficher.
**
** RETOUR : rien.
*/
void ft_putendl(char const *s)
{
int i;
char newline;
i = 0;
newline = '\n';
while (s[i])
{
write(1, &s[i], 1);
i++;
}
write(1, &newline, 1);
}