I\'m trying to convert an incoming sting of 1s and 0s from stdin into their respective binary values (where a string such as \"11110111\" would be converted to 0xF7). This s
You can use strtol
char string[] = "1101110100110100100000"; char * end; long int value = strtol (string,&end,2);