Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
C# 的 Convert.ToInt16(String) 方法的 C 等价物是什么?在我的情况下,我的字符串是一个 char 数组。谢谢
你可以试试atoi。
使用atoi或 strtol。
int n = atoi(s)
你也可以使用sscanf
sscanf("%i", myCharPointer, &myIntVar);