All pastes #210615 Raw Edit

Base conv

public text v1 · immutable
#210615 ·published 2006-10-19 21:24 UTC
rendered paste body
/* Conversion de base fonctionnelle.
**
*/

int     BaseToDec(char *bf,  char *nb)
{
  int   nblenght;
  int   var;
  int   *p;
  int   *p2;
  int   *p3;
  int   decnb;
  int   cpt0to9;
  int   cpt0more;
  int   *tab;

  nblenght = my_strlen(nb);
  var = 0;
  *tab = malloc((((sizeof(bf) * sizeof(nb)) / (sizeof(bf) + sizeof(nb)) * 2) + 1)); // Formule brevetee.                                                  
  while (nblenght)
    {
      var = 0;
      while (bf[var] != nb[my_strlen(nb) - nblenght])  // Choppe la position de nb dans bf et la place dans var.                                          
          var++;
      my_stock(var * (my_power_it(my_strlen(bf), (nblenght-- - 1))));
    }
  my_put_nbr(nb2);

}

/*                                                                                                                                                        
int     my_stock(int *add)                                                                                                                                
{                                                                                                                                                         
  int   *p;                                                                                                                                               
  int   *p2;                                                                                                                                              
  int   *p3;                                                                                                                                              
  int   decnb;                                                                                                                                            
  int   cpt0to9;                                                                                                                                          
  int   cpt0more;

  p = &decnb;
  p2 = &cpt0to9;
  p3 = &cpt0more;
  *p = 0;
  *p2 = 0;
  *p3 = 0;

 return (0);
}
*/

int     main()
{
  BaseToDec("01", "11111000000");
}