commit
This commit is contained in:
22
C_04/git_old/ex01/ft_putstr.c
Normal file
22
C_04/git_old/ex01/ft_putstr.c
Normal file
@@ -0,0 +1,22 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_putstr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/08/13 09:16:54 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/08/13 09:21:15 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_putstr(char *str)
|
||||
{
|
||||
char *p_str;
|
||||
|
||||
p_str = str;
|
||||
while (*p_str != '\0')
|
||||
write(1, p_str++, 1);
|
||||
}
|
||||
30
C_04/git_old/ex01/main.c
Normal file
30
C_04/git_old/ex01/main.c
Normal file
@@ -0,0 +1,30 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* main.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/08/13 09:13:32 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/08/13 09:20:53 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
void ft_putstr(char *str);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char str[32];
|
||||
|
||||
printf("Input String [max 31]: ");
|
||||
scanf("%s", str);
|
||||
ft_putstr(str);
|
||||
write(1, "\n", 1);
|
||||
printf("str=%s (ft_putstr)\n", str);
|
||||
return (0);
|
||||
}
|
||||
8
C_04/git_old/ex01/main.sh
Executable file
8
C_04/git_old/ex01/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