All pastes #256396 Raw Edit

Binary to Decimal

public c v1 · immutable
#256396 ·published 2006-11-24 03:51 UTC
rendered paste body
int bin2dec(char* bin) {        int i, out = 0;        for(i=7;i>=0;i--) {                if(bin[i]=='1') { out += pow(2, (7-i));  }        }        return out;}