Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_putchar.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: lcuzzuco <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2015/07/16 14:09:32 by lcuzzuco #+# #+# */
- /* Updated: 2015/07/16 23:13:30 by lcuzzuco ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include <unistd.h>
- void ft_putchar(char c)
- {
- write (1, &c, 1);
- }
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_putstr.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: lcuzzuco <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2015/07/16 14:13:11 by lcuzzuco #+# #+# */
- /* Updated: 2015/07/16 17:20:49 by lcuzzuco ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include <unistd.h>
- void ft_putchar(char c)
- {
- write(1, &c, 1);
- }
- void ft_putstr(char *str)
- {
- int index;
- index = 0;
- while (str[index])
- {
- ft_putchar(str[index]);
- index++;
- }
- }
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_strcmp.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: lcuzzuco <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2015/07/16 17:47:53 by lcuzzuco #+# #+# */
- /* Updated: 2015/07/16 21:35:42 by lcuzzuco ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include <stdio.h>
- int ft_strcmp(char *s1, char *s2)
- {
- int i;
- i = 0;
- while (s1[i] == s2[i])
- {
- if (s1[i] == '\0' && s2[i] == '\0')
- return (0);
- i++;
- }
- return ((unsigned char)s1[i] - (unsigned char)s2[i]);
- }
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_strlen.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: lcuzzuco <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2015/07/16 15:55:07 by lcuzzuco #+# #+# */
- /* Updated: 2015/07/16 16:43:14 by lcuzzuco ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include <unistd.h>
- int ft_strlen(char *str)
- {
- int i;
- i = 0;
- while (str[i] != '\0')
- {
- i++;
- }
- return (0);
- }
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_swap.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: lcuzzuco <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2015/07/16 14:49:26 by lcuzzuco #+# #+# */
- /* Updated: 2015/07/16 14:49:58 by lcuzzuco ### ########.fr */
- /* */
- /* ************************************************************************** */
- void ft_swap(int *a, int *b)
- {
- int temp;
- temp = *b;
- *b = *a;
- *a = temp;
- }
- ~/correc06/ex00(master ✔)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement