files dans srcs sans dossier
This commit is contained in:
32
srcs/ft_strncat.c
Normal file
32
srcs/ft_strncat.c
Normal file
@@ -0,0 +1,32 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strncat.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2018/11/14 21:18:24 by hulamy #+# #+# */
|
||||
/* Updated: 2019/03/25 15:24:11 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
/*
|
||||
** append n character of src to dest and return dest
|
||||
*/
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
char *ft_strncat(char *dest, const char *src, size_t nb)
|
||||
{
|
||||
size_t i;
|
||||
size_t j;
|
||||
|
||||
i = 0;
|
||||
j = 0;
|
||||
while (dest[i])
|
||||
i++;
|
||||
while (src[j] && j < nb)
|
||||
dest[i++] = src[j++];
|
||||
dest[i] = '\0';
|
||||
return (dest);
|
||||
}
|
||||
Reference in New Issue
Block a user