I have Google'd and all i found was outdated, buggy or not working
source samples. Here is what i tried but i have a bit of a problem:
void toDecimal(char bin[]){
int i, d = 0;
int l = strlen(bin)-1;
int x = 1;
for(i = 0; i < l; i++){
int a = (bin[i] - '0');
x *= 2;
d = d + a * x;
//printf("%d",d); This will just print out 1222222
//printf("%d",x); This will just print out 1 2 4 8 16 ..
}
}
int main(){
toDecimal("10000001");
}