Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ft_putchar.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: pcarre <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2015/08/13 14:42:00 by pcarre #+# #+# */
- /* Updated: 2015/08/13 17:43:10 by pcarre ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include <unistd.h>
- void ft_putchar(char c)
- {
- write(1, &c, 1);
- }
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_putstr.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: pcarre <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2015/08/13 14:43:23 by pcarre #+# #+# */
- /* Updated: 2015/08/13 15:47:41 by pcarre ### ########.fr */
- /* */
- /* ************************************************************************** */
- void ft_putchar(char c);
- void ft_putstr(char *str)
- {
- int i;
- i = 0;
- while (str[i] != '\0')
- {
- ft_putchar(str[i]);
- i++;
- }
- }
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_strcmp.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: pcarre <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2015/08/13 14:48:30 by pcarre #+# #+# */
- /* Updated: 2015/08/13 16:02:55 by pcarre ### ########.fr */
- /* */
- /* ************************************************************************** */
- int ft_strcmp(char *s1, char *s2)
- {
- int i;
- i = 0;
- while (s1[i] != '\0')
- {
- if (s2[i] == '\0')
- {
- return (1);
- }
- if (s2[i] > s1[i])
- {
- return (-1);
- }
- if (s1[i] > s2[i])
- {
- return (1);
- }
- i++;
- }
- if (s2[i] != '\0')
- {
- return (-1);
- }
- return (0);
- }
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_strlen.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: pcarre <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2015/08/13 14:36:57 by pcarre #+# #+# */
- /* Updated: 2015/08/13 15:35:02 by pcarre ### ########.fr */
- /* */
- /* ************************************************************************** */
- int ft_strlen(char *str)
- {
- int i;
- i = 0;
- while (str[i] != '\0')
- {
- i++;
- }
- return (i);
- }
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_swap.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: pcarre <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2015/08/08 23:19:06 by pcarre #+# #+# */
- /* Updated: 2015/08/13 15:48:23 by pcarre ### ########.fr */
- /* */
- /* ************************************************************************** */
- void ft_swap(int *a, int *b)
- {
- int temp;
- temp = *a;
- *a = *b;
- *b = temp;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement