◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
C程序的基本语法成分讲的是C语言的字符集、标识符和关键字。
基本字符集
字符集是构成C/C++程序的基本元素。用C/C++语言编写程序时,除字符型数据外,其他所有成分都只能由字符集中的字符构成。
标识符
所谓标识符,就是一个名字,如变量名、函数名、数组名、类名、对象名等等等等。C/C++程序中有效标识符的构成规则如下:
注意:标识符的长度各种系统有所不同。例如turbo c 只能识别前32个字符。而在C++中,标识符的长度没有限制。
举几个标识符不正确的例子:
关键字
C编译系统已经预定的、具有特殊用途的保留标识符称为关键字。下面列出C/C++的关键字,关于关键字的意义和用法,在以后使用中会逐渐了解。
auto bool break case catch char class const const_cast continue default delete do double dynamic_cast else enum explicit extern false float for friend goto if inline int long mutable namespace new operator private protected public register reinterpret_cast return short signed sizeof static static_cast struct switch template this throw true try typedef typeid typname union unsigned using virtual viod volatile while