Is there any dedicated function for converting the binary values to decimal values. such as (1111 to 15 ) , ( 0011 to 3 ) .
Thanks in Advance
Parse it with strtol, then convert to a string with one of the printf functions. E.g.
char binary[] = "111"; long l = strtol(binary, 0, 2); char *s = malloc(sizeof binary); sprintf(s, "%ld\n", l);
This allocates more space than needed.