要声明变量,可从数据类型开始,然后添加标识符,该标识符是变量的名称。

int myInt;

变量名称可以包含字母,数字和下划线,但不能以数字开头。

它也不能包含空格或特殊字符,也不能是保留关键字。

int _myInt32; /* allowed */
int 32Int;    /* incorrect (starts with number) */
int my Int;   /* incorrect (contains space) */
int Int@32;   /* incorrect (contains special character) */
int return;   /* incorrect (reserved keyword) */