Add main.* and remove .gitignore
This commit is contained in:
35
C_Piscine_C_03/git/ex04/main.c
Normal file
35
C_Piscine_C_03/git/ex04/main.c
Normal 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);
|
||||
}
|
||||
8
C_Piscine_C_03/git/ex04/main.sh
Executable file
8
C_Piscine_C_03/git/ex04/main.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
#norminette -R CheckForbiddenSourceHeader ft_*.c
|
||||
norminette -R CheckForbiddenSourceHeader
|
||||
gcc -Wall -Wextra -Werror -o a.out *.c
|
||||
echo $(basename $PWD):
|
||||
./a.out
|
||||
rm -f a.out
|
||||
Reference in New Issue
Block a user