RidaSana
RidaSana

Reputation: 563

identifier and variables in C

can we say that identifier are alias of variables? are identifier and variables same?

Upvotes: 0

Views: 1103

Answers (4)

nos
nos

Reputation: 229118

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.

Upvotes: 3

wtf
wtf

Reputation: 31

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

Upvotes: 3

jefflunt
jefflunt

Reputation: 33954

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.

Upvotes: 3

James McNellis
James McNellis

Reputation: 355079

No.

int f() { }

f is an identifier. It is not a variable.

Upvotes: 3

Related Questions