C++保留字

来源:互联网 发布:eml文件怎么打开 mac 编辑:程序博客网 时间:2024/05/16 11:48

保留字

并不是每一个合法的标识符都能被程序员所使用,有一些特殊的标识符,是不能用在用户自己的对象上的,他们被称作保留字。编译器需要使用这些保留字来分析程序的语法结构,进而理解程序。你可以把他们理解成英文里做助动词的have do 和助词that when why 的作用。程序中的 main int include return 都是保留字。都有对应的特殊含义。幸好这些保留字并不多,全部列出如下:

asm auto bool break case catch char class const const_cast continue default delete do double dynamic_cast else enum explicit export 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 typename union unsigned using virtual void volatile wchar_t while and、and_eq、bitand、bitor、compl、not、not_eq、or、or_eq、xor xor_eq

原创粉丝点击