Identifier in C++

 Identifier in C++

 Identifier refer to the name of variable,, function, array, classes, etc. created by the programmer. They are the fundamental requirement of any language. Each language has its own rules for naming these identifiers.

Identifier in C++


{tocify} $title={Table of Contents}

The following rules are common to both C and C++:-

·         Only alphabetic character, digit and underscore are permitted.

·         The name cannot start with digit.

·         Uppercase and lowercase letter are distinct.

·         A declare keyword cannot be used as a variable name.

 

C++ does not allow punctuation characters such as @, $, and % within identifiers. C++ is a case-sensitive programming language. Thus, Manpower and manpower are two different identifiers in C++.

 

Here are some examples of acceptable identifiers in C++:−

 

simple       neeraj    xyz   move_name    x_123

 

name10   _temp      m      a2cb               rasJav

 




Data science & data analyst

C++

Algorithms

Technology

Post a Comment

Ask any query by comments

Previous Post Next Post