我有一段C代码:
Int32 tmp = atoi("314");
它抛出一个错误:
error: Int32 undeclared (first use in this function)
我不知道为什么?你能帮帮我吗?
可能是 #include
的问题:
sys/socket.h
netinet/in.h
arpa/inet.h
stdio.h
stdlib.h
string.h
strings.h
最佳答案
没有称为Int32
的标准类型.您可能正在寻找
int tmp = atoi("314");
如果需要32位整数,标准类型是int32_t
在 inttypes.h
中定义或 stdint.h
.
关于c - 如何使用 atoi() 将类型转换为 Int32,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9806570/