0
0

Add main.* and remove .gitignore

This commit is contained in:
2021-08-16 08:26:30 +02:00
parent a808b91a50
commit 44692816d5
85 changed files with 1352 additions and 30 deletions

View File

@@ -0,0 +1,35 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* 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);
}