je tente de recoderr la fonction prints si je pouvais avoir un coup de main je serais tres heureux

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
 
int	my_putstr(char *str);
int	my_strlen(char *str);
 
int	my_printf(const char *str,  ...)
{
  va_list	push;
  char		*string;
  int		i;
  int		j;
 
  i = 0;
  while (i != '\0')
    {
      i++;
    }
  va_start(push, i);
  while (j <= i)
    {
      string = va_arg(push, char *);
      my_putstr(string);
      j++;
    }
  va_end(push);
  return (0);
}
 
int	main(void)
{
  my_printf("salut moi");
  return (0);
}
 
int	my_putstr(char *str)
{
  write(1, str, my_strlen(str));
  return (0);
}
 
int	my_strlen(char *str)
{
  int	i;
 
  i = 0;
  while (str[i] != '\0')
    {
      i++;
    }
  return (i);
}