#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdio.h>
char *binary_to_string(const char *binary) {
char *ascii = (char *)malloc( sizeof(char) * strlen( binary ) );
int i, cnt = 0;
while( *binary )
{
char sum = 0;
for( i = 7; i >= 0; i-- )
{
if( *binary++ - '0')
sum += (char)pow( 2, i );
}
ascii[cnt++] = sum;
}
ascii[cnt] = '\0';
return ascii;
}