Miscellany
public text v1 · immutable
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);
}