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