ft_strlen()
This commit is contained in:
parent
48d761f40e
commit
ad2fae898b
3 changed files with 39 additions and 2 deletions
34
ft_strlen_test.c
Normal file
34
ft_strlen_test.c
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strlen_test.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: lalgarra <lalgarra@student.42madrid.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/10/03 18:27:44 by lalgarra #+# #+# */
|
||||
/* Updated: 2025/10/04 12:15:34 by lalgarra ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
void do_test(const char *buff)
|
||||
{
|
||||
printf("ft_strlen(\"%s\"): %lu; strlen(): %lu; are equal: %i\r\n",
|
||||
buff, ft_strlen(buff), strlen(buff), ft_strlen(buff) == strlen(buff));
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char buff[255];
|
||||
|
||||
strcpy(buff, "");
|
||||
do_test(buff);
|
||||
strcpy(buff, "Iorem ipsum dolor");
|
||||
do_test(buff);
|
||||
strcpy(buff, "Iorem ip\0sum dolor");
|
||||
do_test(buff);
|
||||
return (0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue