C++ Variables

Variables: Variable is the name of memory location. It is used to store to data. Value of variable can be changed or reused.

Rules to define Variables:

  • Alphabets and digits can be used.
  • First character can be alphabet or underscore.
  • Digit can not be used as first character.
  • Underscore can only be used from special character.
  • It can’t contain spaces.
  • These are case-sensitive.

Example Of Variable:

Name morningstar  morning_star morning1 morning

Invalid Variables:

101  int   $money  morning star   10th

Back To Top