手机分类
  导航: 电脑时代在线 · 程序设计 · C语言 · C语言编程技巧
有问题吗?看 疑难解答 电脑术语

Reserved Names

 
硬件盘点
手机推荐
 
『Reserved Names』如果文章有大量图片,显示会较慢,请等待图片下载完成
 
点击数: 更新时间:2005-8-4 
The names of all library types, macros, variables and functions that come from the ISO C standard are reserved unconditionally; your program may not redefine these names. All other library names are reserved if your program explicitly includes the header file that defines or declares them. There are several reasons for these restrictions:

Other people reading your code could get very confused if you were using a function named exit to do something completely different from what the standard exit function does, for example. Preventing this situation helps to make your programs easier to understand and contributes to modularity and maintainability.
It avoids the possibility of a user accidentally redefining a library function that is called by other library functions. If redefinition were allowed, those other functions would not work properly.
It allows the compiler to do whatever special optimizations it pleases on calls to these functions, without the possibility that they may have been redefined by the user. Some library facilities, such as those for dealing with variadic arguments (see section Variadic Functions) and non-local exits (see section Non-Local Exits), actually require a considerable amount of cooperation on the part of the C compiler, and implementationally it might be easier for the compiler to treat these as built-in parts of the language.
In addition to the names documented in this manual, reserved names include all external identifiers (global functions and variables) that begin with an underscore (`_') and all identifiers regardless of use that begin with either two underscores or an underscore followed by a capital letter are reserved names. This is so that the library and header files can define functions, variables, and macros for internal purposes without risk of conflict with names in user programs.

Some additional classes of identifier names are reserved for future extensions to the C language or the POSIX.1 environment. While using these names for your own purposes right now might not cause a problem, they do raise the possibility of conflict with future versions of the C or POSIX standards, so you should avoid these names.

Names beginning with a capital `E' followed a digit or uppercase letter may be used for additional error code names. See section Error Reporting.
Names that begin with either `is' or `to' followed by a lowercase letter may be used for additional character testing and conversion functions. See section Character Handling.
Names that begin with `LC_' followed by an uppercase letter may be used for additional macros specifying locale attributes. See section Locales and Internationalization.
Names of all existing mathematics functions (see section Mathematics) suffixed with `f' or `l' are reserved for corresponding functions that operate on float and long double arguments, respectively.
Names that begin with `SIG' followed by an uppercase letter are reserved for additional signal names. See section Standard Signals.
Names that begin with `SIG_' followed by an uppercase letter are reserved for additional signal actions. See section Basic Signal Handling.
Names beginning with `str', `mem', or `wcs' followed by a lowercase letter are reserved for additional string and array functions. See section String and Array Utilities.
Names that end with `_t' are reserved for additional type names.
In addition, some individual header files reserve names beyond those that they actually define. You only need to worry about these restrictions if your program includes that particular header file.

The header file `dirent.h' reserves names prefixed with `d_'.
The header file `fcntl.h'

[1] [2] 下一页  


如果您有什么疑问,可以至论坛提出或者解答他人的疑问   返回页面顶部

】【关闭窗口
·上一篇教程:
·下一篇教程:
·导航: 电脑时代在线 · 程序设计 · C语言 · C语言编程技巧
相关文章
 
搞笑自拍|图片故事|美女图库|体坛宝贝|明星爆料|世界奇观|风光摄影|历史回忆|大千世界
Photshop超炫图片
advertisement
关于站点 - 广告服务 - 联系我们 - 版权隐私 - 免责声明 - 合作伙伴 - 程序支持 - 网站地图 - 返回顶部  
网站文本地图
  版权所有:电脑时代在线 2005-2007 欢迎各种媒体转载我们的原创作品[转载请注明出处]
copyright © 2005-2007 www.PCvz.com online services. all rights reserved. 蜀ICP备05015578
Template designed by LaoJiang. Optimized for 1024x768 to Firefox,Opera and MS-IE. Site powered by EQL.
红盾
热爱电脑,热爱生活
拥有电脑,拥有生命
让我们享受拥有电脑的时光