首页 | 官方网站   微博 | 高级检索  
     

一个C 语言的命名问题
引用本文:陈伟,董勇,刘彦艳,郭磊. 一个C 语言的命名问题[J]. 兵工自动化, 2014, 33(6): 95-96
作者姓名:陈伟  董勇  刘彦艳  郭磊
作者单位:[1]中国兵器工业第五八研究所军品部,四川绵阳621000 [2]总装备部炮兵防空兵装备技术研究所,北京100012 [3]总装备部北京第三离职干部休养所,北京100101
摘    要:针对一次全局函数和全局变量命名相同引起的软件故障问题,对C语言的命名问题进行研究。研究验证结果表明:当全局变量名与全局函数名相同时,变量指向了函数代码或函数指向了变量地址,这2种情况都会引起程序异常的发生。文中给出了避免该问题的方法。

关 键 词:软件  故障  异常  命名
收稿时间:2014-06-27

A Naming Problem of C Language
Chen Wei,Dong Yong,Liu Yanyan,Guo Lei. A Naming Problem of C Language[J]. Ordnance Industry Automation, 2014, 33(6): 95-96
Authors:Chen Wei  Dong Yong  Liu Yanyan  Guo Lei
Affiliation:1. Department of Military Products, No. 58 Research Institute of China Ordnance Industries, Mianyang 621000, China; 2. Institute of Equipment Technology of Artillery & Air Defense, The General Equipment Department, Beijing 100012, China; 3. No. 3 Rest of Beijing Cadres Leaving, The General Equipment Department, Beijing 100101, China)
Abstract:Aiming at the software failure problem which caused by the same name of global function and global variable, research on Clanguage naming problem. The research verification results show:when a global function name is same as a global variable name in a C program, the variable will point to the function code or the function will point to the variable space, and will result in software failure. The paper gives some suggestions.
Keywords:software  failure  exception  naming
本文献已被 CNKI 维普 等数据库收录!
点击此处可从《兵工自动化》浏览原始摘要信息
点击此处可从《兵工自动化》下载免费的PDF全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司    京ICP备09084417号-23

京公网安备 11010802026262号