general improvement
This commit is contained in:
@@ -87,6 +87,7 @@ int ft_printf(const char *fstr, ...);
|
||||
int ft_fprintf(int fd, const char *str, ...);
|
||||
char *ft_sprintf(const char *str, ...);
|
||||
int ft_debug(const char *fstr, ...);
|
||||
char *rep_c(char c, int count);
|
||||
|
||||
char *get_next_line(int fd);
|
||||
|
||||
|
||||
23
lib/libft/srcs/print/rep_c.c
Normal file
23
lib/libft/srcs/print/rep_c.c
Normal file
@@ -0,0 +1,23 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* rep_c.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: nalebrun <nalebrun@student.s19.be> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/10 10:19:40 by nalebrun #+# #+# */
|
||||
/* Updated: 2025/02/10 10:19:40 by nalebrun ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../../libft.h"
|
||||
|
||||
char *rep_c(char c, int count)
|
||||
{
|
||||
char *out;
|
||||
|
||||
out = malloc(sizeof(char) * (count + 1));
|
||||
ft_memset(out, c, count);
|
||||
out[count] = 0;
|
||||
return (out);
|
||||
}
|
||||
Reference in New Issue
Block a user