汉理工大学计理中院中心技交,0000计算机程序设计基础C语言主讲教师:王舜燕武汉理工大学Wuhan Universityof Technology
主讲教师:王舜燕
计算机程序设计基础C语言0(Keywords)C语言的关键字(Identifiers)C语言的标识符武汉理工大学Wuhan Universityof Technology
计算机程序设计基础C语言 ⚫ C语言的关键字(Keywords) ⚫ C语言的标识符(Identifiers)
(Keywords)C语言的关键字在C语言程序中,标识符和关键字都属于程序的基本语法单位。正确地使用标识符和关键字对于程序编制是至关重要的。关键字(KeyWords)是C语言中明确的保留字,它们有特定的含义,不能用作其他用途。C关键字有32个:(VC++中呈蓝色)autobreakcharcontinuecaseconstdodefaultdoubleelseexternenumiffloatforintlonggotosizeofshortsignedstaticregisterreturnswitchtypedefstructunionvoidwhileunsignedvolatile
C语言的关键字(Keywords) ◼在C语言程序中,标识符和关键字都属于程序的基本语法单位。正确地 使用标识符和关键字对于程序编制是至关重要的。 ◼关键字(Keywords)是C语言中明确的保留字,它们有特定的含义,不 能用作其他用途。C关键字有32个:(VC++中呈蓝色) auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while
(Identifiers)C语言的标识符标识符由学母、数字、下划线组成,必须以字母或下划线开头,不要数学开头,不要是关键字,不能有空格。大写字母小写字母被认为是不同的字符,在标识符中不能含有其他字符,也不能跨行书写。An identifier is a sequence of letters(A-Z, a-z), digits(O-9), and the underscore(), characterIdentifiersmaynotbeginwithadigit关键学不能用来作为标识符,库函数名如printf、scanf等也不能用来作为标识符。VisualC++中标识符有效长度可达255个字符。良好的命名习惯会让程序的可读性、可维护性大大加强,例如:student name,age,birthday等。main是个特殊的标识符。main函数是执行程序的入口。mainisaspecialidentifier.Itnamesthefunctionwhichwillbegiven control when aprogram is invoked
C语言的标识符(Identifiers) 标识符由字母、数字、下划线组成,必须以字母或下划线开头,不要数字 开头,不要是关键字,不能有空格 。大写字母小写字母被认为是不同的字 符,在标识符中不能含有其他字符,也不能跨行书写。 An identifier is a sequence of letters(A-Z, a-z), digits(0-9), and the underscore(_), character. Identifiers may not begin with a digit. 关键字不能用来作为标识符,库函数名如printf、scanf等也不能用来 作为标识符。 Visual C++中标识符有效长度可达255个字符。 良好的命名习惯会让程序的可读性、可维护性大大加强, 例如:student_name,age,birthday等。 main是个特殊的标识符。 main函数是执行程序的入口。 main is a special identifier. It names the function which will be given control when a program is invoked