浅谈C语言的常见陷阱
Brief Discussion about Common Traps of C Language
石也牧1
作者信息
- 1. 华中师范大学人工智能教育学部 湖北 武汉 430079
- 折叠
摘要
C语言的语法限制不太严格,比如,不需要排版对齐,数组下标越界不算编译问题,也不会运行出错,虽然灵活,但也使得程序容易出现缺陷.无论是初学者还是有经验的程序员,要想增强软件的稳健性和可维护性,学习和研究C语言缺陷是十分必要的.文章给出了一些常见陷阱的例子,对C用户提高代码质量会有所帮助.
Abstract
The grammatical restrictions of C language are not strict,for example,typesetting alignment is not required,an array subscript out of bounds is not a compiling problem,and there are no run-time errors.Despite the flexibility,it also makes programs prone to defects.It is necessary for both beginners and experienced programmers to learn and study the defects of C language so as to enhance the robustness and maintainability of software.This paper gives some examples of common traps,which can help C users to improve code quality.
关键词
C编程语言/代码缺陷/程序陷阱Key words
C programming language/code defects/program traps引用本文复制引用
出版年
2024