开发者

identifier and variables in C

can we say that identifier are alias of variabl开发者_高级运维es? are identifier and variables same?


To say it another way, identifiers are the names given to things (such as variables and functions). They identify the thing which they are naming.


No.

int f() { }

f is an identifier. It is not a variable.


Identifier is the fancy term used to mean ‘name’. In C, identifiers are used to refer to a number of things: we've already seen them used to name variables and functions. They are also used to give names to some things we haven't seen yet, amongst which are labels and the ‘tags’ of structures, unions, and enums.

An identifier is used for any variable, function, data definition, etc. In the C programming language, an identifier is a combination of alphanumeric characters, the first being a letter of the alphabet or an underline, and the remaining being any letter of the alphabet, any numeric digit, or the underline. and you know about variables. please check C Tutorial - Chapter 1


No, from C99 (6.2.1):

An identifier can denote an object; a function; a tag or a member of a structure, union, or enumeration; a typedef name; a label name; a macro name; or a macro parameter.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜