Identifiers in C Programming

0
An identifier in C programming is a sequence of nondigit characters (including the underscore _, the lowercase and uppercase Latin letters, and other characters) and digits. The syntax for an identifier is as follows:

identifier:
identifier-nondigit
identifier identifier-nondigit
identifier digit

The nondigit characters can be one of the following:

_ a b c d e f g h i j k l m
n o p q r s t u v w x y z
A B C D E F G H I J K L M
N O P Q R S T U V W X Y Z

And the digit can be one of the following:

0 1 2 3 4 5 6 7 8 9

Lowercase and uppercase letters are distinct in identifiers. Each universal character name in an identifier designates a character whose encoding in ISO/IEC 10646 falls into one of the ranges specified in D.1. The initial character should not be a universal character name designating a character whose encoding falls into one of the ranges specified in D.2.

When preprocessing tokens are converted to tokens during translation phase 7, if a preprocessing token could be converted to either a keyword or an identifier, it is converted to a keyword.

Implementation Limits

An implementation may limit the number of significant initial characters in an identifier. The limit for an external name (an identifier that has external linkage) may be more restrictive than that for an internal name (a macro name or an identifier that does not have external linkage). Any identifiers that differ in a significant character are different identifiers.

Predefined Identifiers

The identifier `__func__` is implicitly declared by the translator as if, immediately following the opening brace of each function definition, the declaration `static const char __func__[] = "function-name";` appeared, where `function-name` is the name of the lexically-enclosing function.
Tags

Post a Comment

0Comments
Post a Comment (0)