库函数....标准?? [英] Library Functions .... Standard ??

查看:92
本文介绍了库函数....标准??的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编译器提供的库函数是否可移植?

即这些函数是否有任何ANCI C标准。


例如。 < conio.h>中定义的getch()函数头文件工作得很好

windows C编译器但linux中的gcc编译器无法识别它。


gcc编译器没有定义< conio.h>头文件。

Library Functions provided by the compiler, are they portable?
i.e. is there any ANCI C standards for these functions.

eg. getch() function defined in <conio.h> header file works fine in
windows C compiler but gcc compiler in linux does not recognise it.

gcc compiler does not define <conio.h> header file.

推荐答案

santosh写道:
santosh wrote:
编译器提供的库函数是否可移植?
即是否有这些功能的ANCI C标准。

例如。 < conio.h>中定义的getch()函数头文件在windows C编译器中运行正常但linux中的gcc编译器无法识别它。

gcc编译器没有定义< conio.h>头文件。
Library Functions provided by the compiler, are they portable?
i.e. is there any ANCI C standards for these functions.

eg. getch() function defined in <conio.h> header file works fine in
windows C compiler but gcc compiler in linux does not recognise it.

gcc compiler does not define <conio.h> header file.



如果您坚持使用C标准中指定的标准C库,

您的代码将是可移植的。


gcc没有提供< conio.h> ;, Windows确实如此。


-

Ian Collins。


If you stick with the standard C library as specified in the C standard,
your code will be portable.

gcc doesn''t provide <conio.h>, Windows does.

--
Ian Collins.




santosh写道:

santosh wrote:
编译器提供的库函数是否可移植?


不是全部。可能有一些特定于你的编译器的函数,比如

getch()你有下面的pointe dout。

即这些函数是否有任何ANCI C标准。

例如。 < conio.h>中定义的getch()函数头文件在windows C编译器中运行正常但linux中的gcc编译器无法识别它。

gcc编译器没有定义< conio.h>头文件。
Library Functions provided by the compiler, are they portable?
Not all. There may be some functions specific to your compiler like
getch() which you have pointe dout below.
i.e. is there any ANCI C standards for these functions.

eg. getch() function defined in <conio.h> header file works fine in
windows C compiler but gcc compiler in linux does not recognise it.

gcc compiler does not define <conio.h> header file.



http ://www-ccs.ucsd.edu/c/lib_over.html



http://www-ccs.ucsd.edu/c/lib_over.html


" santosh" < SA *********** @ gmail.com>写道:
"santosh" <sa***********@gmail.com> writes:
编译器提供的库函数是否可移植?
即是否存在这些函数的ANCI C标准。


有些是标准的,有些是不是。搜索n1124.pdf看看

最新的标准草案;第7节定义了标准的

库。实现通常提供额外的功能。

(理想情况下,您的文档应该告诉您哪些功能是标准的b $ b和哪些功能不是。)

例如。 < conio.h>中定义的getch()函数头文件在windows C编译器中运行正常但linux中的gcc编译器无法识别它。

gcc编译器没有定义< conio.h>头文件。
Library Functions provided by the compiler, are they portable?
i.e. is there any ANCI C standards for these functions.
Some are standard, some aren''t. Search for "n1124.pdf" to see the
most current draft of the standard; section 7 defines the standard
library. Implementations typically provide additional functions.
(Ideally your documentation should tell you which functions are
standard and which ones are not.)
eg. getch() function defined in <conio.h> header file works fine in
windows C compiler but gcc compiler in linux does not recognise it.

gcc compiler does not define <conio.h> header file.




getch()和< conio.h>都不是。由C标准定义。


-

Keith Thompson(The_Other_Keith) ks *** @ mib.org < http://www.ghoti.net/~kst>

圣地亚哥超级计算机中心< *> < http://users.sdsc.edu/~kst>

我们必须做点什么。这是事情。因此,我们必须这样做。



Neither getch() nor <conio.h> is defined by the C standard.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.


这篇关于库函数....标准??的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆