character set identifier and comments in C++

Here in this, we will learn the following,

Download this as PDF format header file character set identifier and comments in C++

C++ character set

In practical terms, the Character set is in which we write C++ Program, which means that c++ supports. As is the updated version of c++ c, so a lot of C++ features have been taken from c in which the character set is one. That is how it is.

alphabets a – b  , A – Z
numeric values 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
special character !,  @,  #,  $,  %,  ^,  &,  *,  (,  ),  {,  }

Because C++ language case sensitive language, so both alphabet and lowercase are considered as different characters, meaning that C++ contains 52 alphabets (26 lowercase a-z and 26 uppercase A-Z).

C++ identifier

The identifier, in the program, is the name of a variable, object, function, array, structure or class. as a boy, place or city name is an identifier in the real world

Rule of declaring an identifier in C++

There are some rules to give the name identifier in c or c++ as follows-

  • Only alphabet character and underscore can make identifier.
  • Can not be a special character identifier.
  • Because there is no length set for Identifier, so any sentence can be an identifier such as name, address.
  • uppercase and lowercase will be two different types of an identifier such as name and Name both will be different types of identifier.
  • a reserved keyword which C++ already define you can not take them as an identifier.
  • an identifier will never start with numbers.

its similar of Rule of a variable declaration in C++

C++ comments

In C++ comments is an explanation of statements in the program, its give facility to explain our codes in the program so that others can easily understand it. The compiler does not read comments, so we can write anything in comments.

Sometimes it is also helpful for programmers. After several days, if you want to work with an old program, then some of its codes are not understood. In such a situation, comments overcome this problem and it’s also helpful in debugging the program. so always use comments in the program.

In C++ we can use comments in two ways as follows,

C++ single line comment

Double slash(//) It is used to give single-line comments. such as,

// This is single line comment
//Programmer give explanation for statement

C++ multi-line comment

multiline comments used in multi-line statements in the program.  such as,

/* This is an example 
    of multi-line
    Comments    */

However, according to our preference // can be used for multi-line and  /*……..*/  for single-line.


previous- token and keyword in C++

next- constant and their type in C++


Did You understand this article well ?

Like it?

Leave a Reply

Your email address will not be published.