Bonjour, ci apres le code d une fonction que je vien de realiser... le souci celle ci fait beaucoup de ligne, l ideal serai qu elle n en fasse que 25 , je doit donc la decouper, cependant je bug un peu notamen a cause des pointeurs...
Merci d avance
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
54
55
56
57
58
 
void            my_printopt(char **str, va_list *ap)
{
  t_flag        *my_struct;
  int           width;
  int           i;
 
  width = 0;
  i = 0;
  (*str)++;
  my_struct = init();
  if (*(*str) == '-' || *(*str) == '+' || *(*str) == ' ' || *(*str) == '#'
      || *(*str) == '0')
    {
      my_struct->flags = *(*str);
      (*str)++;
    }
  else
    my_struct->flags = '~';
  while (*(*str) >= '0' && *(*str) <= '9')
    {
      width = width * 10 + *(*str) - '0';
      (*str)++;
    }
  if (width)
    my_struct->width = width;
  else
    my_struct->width = -1;
  width = 0;
  if (*(*str) == '.')
    {
      (*str)++;
      if (*(*str) == '*')
        my_struct->precision = -2;
      else
        {
          while (*(*str) >= '0' && *(*str) <= '9')
            {
              width = width * 10 + *(*str) - '0';
              (*str)++;
            }
          if (width)
            my_struct->precision = width; 
         else
            my_struct->precision = -1;
        }
    }
  my_struct->list = ap;
  while (op_print[i].opt)
    {
      if (*(*str) == op_print[i].opt)
        {
          op_print[i].fct_p(my_struct);
        }
      i++;
    }
  free(my_struct);
}
Ps le for est interdi