Binary String to Integer with 'atoi()'

后端 未结 2 1342
栀梦
栀梦 2021-02-07 11:41

I have a string of binary that I then convert to an integer using atoi(). When I do this it seems to automatically convert the binary to decimal. The issue is that

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-07 11:53

    It sounds like you should be using strtol() with 2 as the last argument.

提交回复
热议问题