【发布时间】:2012-11-09 04:43:09
【问题描述】:
我正在编写一个小型 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 for isdigit() 都将 isnumber() 列为 C 标准库 libc, -lc 的一部分。当我在 Linux 上将 -lc 添加到编译标志时,它仍然无法编译。
为什么这个函数包含在 Unix 的某些形式中而不包含在其他形式中?
【问题讨论】:
标签: c linux macos unix compiler-construction