我正在编写一个小型 C 程序,在其中调用该isnumber()函数。
#include <ctype.h>
char c
if(isnumber(c))
{ foo }
这在我的 Mac (OS X 10.8) 上编译没有问题。但是,当我将它上传到 CentOS 6.x 服务器时,它不会编译。此外,OS Xman页面isdigit()描述isnumber(),但 CentOSman页面没有。就好像它根本不存在于 Linux 机器上一样。OS Xman页面isdigit()和通用 Unixman页面都isdigit()被isnumber()列为 C 标准库的一部分libc, -lc。当我-lc在 Linux 上添加编译标志时,它仍然无法编译。
为什么这个函数包含在 Unix 的某些形式中而不包含在其他形式中?