I wrote a function in C that convert a binary number to a decimal one:
while (n != '\n')
{
scanf("%c",&n);
if (n == '1')
var = var * 2 + 1;
else if (n == '0')
var *= 2;
}
Now I wonder how to put each number of the decimal in an array of char.
Ex: var=145 is the converted number, so the array should be like this:
char array[n_bit]={1,4,5};