1.3.3 保留字
在C++(www.cppentry.com)程序中,保留字又称为关键字,是有特定含义的单词,这些标识符对C++(www.cppentry.com)编译程序有着特殊的含义。对于保留字,在编程(www.cppentry.com)时不能用于其他用途。表1-1中列出了常用的保留字,其含义和用法在相关的章节中再做详细介绍。
表1-1 C++(www.cppentry.com)常用保留字
|
asm< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> |
auto |
bool |
break |
case |
catch |
char |
|
class |
const |
continue |
default |
delete |
do |
double |
|
else |
enum |
extern |
false |
float |
for |
friend |
|
goto |
if |
inline |
int |
long |
main |
namespace |
|
new |
operator |
private |
protected |
public |
register |
return |
|
short |
signed |
sizeof |
static |
struct |
switch |
template |
|
this |
throw |
true |
try |
typedef |
typeied |
typename |
|
union |
unsigned |
using |
virtual |
void |
volatile |
while |
说明:读者在定义标识符的时候,不能定义与表1-1中同名的标识符,否则在程序运行时将出现错误。