All pastes #220672 Raw Edit

Miscellany

public text v1 · immutable
#220672 ·published 2006-10-25 08:36 UTC
rendered paste body

int     my_strlen(char *str);
int     my_power_it(int nb, int power);

int     DecToBase(char *bf,  char *nb)
{
  int   bflenght;
  int   nblenght;
  int   var;
  int   res;

  res = 0;
  bflenght = my_strlen(bf);
  nblenght = my_strlen(nb);
  while (nblenght)
    {
      var = 0;
      while (bf[var] != nb[my_strlen(nb) - nblenght])
        var++;
      res += (var * (my_power_it(my_strlen(bf), (nblenght-- - 1))));
    }
  return (res);
}