0
0
Files
42piscine/C_03/git/ex04/main.c
Guy Baconniere d30270c485 commit
2021-08-20 10:02:38 +02:00

36 lines
1.4 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/12 16:49:41 by gbaconni #+# #+# */
/* Updated: 2021/08/12 17:07:20 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
char *ft_strstr(char *str, char *to_find);
int main(void)
{
char str[32];
char to_find[32];
char *r;
printf("Input String #1 [max 31]: ");
scanf("%s", str);
printf("Input String #2 [max 31]: ");
scanf("%s", to_find);
r = ft_strstr(str, to_find);
printf("str=%s to_find=%s result=%s (ft_strstr)\n", str, to_find, r);
r = strstr(str, to_find);
printf("str=%s to_find=%s result=%s (strstr)\n", str, to_find, r);
return (0);
}