2016-03-18 127 views
0

如何将二进制转换为浮点?我没有看到这个实现(只浮点到二进制)。将二进制转换为浮点

因此,例如:

int main() { 
    char example[32] = "-101.1101"; 
    float result = makeFloat(example); 
    printf("Float number representation is: %f\n", result); 
} 

float makeFloat(char* f) { 
    /* Empty */ 
} 

,输出将是:

-5.8125 

试图让一些练习,但试图小时后弄明白,我在这里要求帮帮我。

+0

感谢您花费力气,但你需要显示的结果,直到时间。 –

+0

欢迎来到堆栈溢出!请直到显示您的研究成果。请先阅读[问]页面。 –

+0

[strtod](http://www.tutorialspoint.com/c_standard_library/c_function_strtod.htm)如果你想要一个func。如果你想实施它,展示你的努力。 – LPs

回答

相关问题