What is C++

 C++ is a powerful and helpful programming language. Both structured and object-oriented applications can be written in C++. Since C++ is a superset of C, most C constructs are valid in C++ and retain their meaning. There are several additions and exceptions, though.

Each group of letters separated by white space in a C++ program’s source code is referred to as a token by the compiler. The minor individual units in a program are tokens. Tokens are used while writing C++ programs. The following components are present:

  • Keywords
  • Identifiers
  • Constants
  • Strings
  • Operators

Reserved words, usually referred to as keywords, are always written or typed in short (lowercase) and have specific meanings for the C++ compiler. Words like the void, int, public, etc., that the language employs for a particular function are examples of keywords. It cannot be used as the name of a variable or function. The table for the entire list of C++ keywords can be seen below.

How identifier differs from keywords and what it is:

How identifier differs from keywords and what it is:

Identifiers are the names given to the programmer-created variables, functions, arrays, classes, etc. They are a necessary condition for any language.

Identifier naming conventions:

A number or other unique character cannot begin the name of the identifier.

You cannot use a keyword as an identification name.

Only numbers underscore, and alphabetic letters are allowed.

There is a distinction between capital and lowercase letters. A and an are distinct in C++, for example.

GFG, gfg, and geeks for geeks are all acceptable identities.

How are keywords distinct from IDs at this point?

How are keywords distinct from IDs at this point?

There are a few fundamental characteristics of keywords that set them apart from identifiers:

  • While identifiers are the values used to construct various programming objects like variables, integers, structures, and unions, keywords are predefined or reserved words.
  • While identifiers can also begin with a capital letter, keywords always start with a lowercase letter.
  • Identification can include alphabetic characters, numbers, and underscores, but a keyword must only have alphabetical characters.
  • Punctuation is used in keywords and identifiers; there is no particular symbol. An identification can only contain the underscore character.

Examples of IDs and keywords

  • Keywords: while, do, int, char.
  • Geeks-for-Geeks, GFG, and Gfg1 are identifiers.

Now that you know more about C++ Programming, here are the keywords:

  1. alignas 
  2. alignof 
  3. and
  4. and_eq
  5. asm
  6. atomic_cancel 
  7. atomic_commit 
  8. atomic_noexcept 
  9. auto 
  10. bitand
  11. bitor
  12. bool
  13. break
  14. case
  15. catch
  16. char
  17. char8_t 
  18. char16_t 
  19. char32_t 
  20. class 
  21. compl
  22. concept 
  23. const
  24. consteval
  25. constexpr 
  26. Content
  27. const_cast
  28. continue
  29. co_await 
  30. co_return
  31. co_yield 
  32. decltype 
  33. default 
  34. delete
  35. do
  36. double
  37. dynamic_cast
  38. else
  39. enum
  40. explicit
  41. export 
  42. extern 
  43. false
  44. float
  45. for
  46. friend
  47. goto
  48. if
  49. inline
  50. int
  51. long
  52. mutable 
  53. namespace
  54. new
  55. noexcept
  56. not
  57. not_eq
  58. nullptr 
  59. operator
  60. or
  61. or_eq
  62. private
  63. protected
  64. Public
  65. ​​reflexpr 
  66. register 
  67. reinterpret_cast
  68. requires 
  69. return
  70. short
  71. signed
  72. sizeof 
  73. static
  74. static_assert 
  75. static_cast
  76. struct 
  77. switch
  78. synchronized 
  79. template
  80. this 
  81. thread_local 
  82. throw
  83. true
  84. try
  85. typedef
  86. typeid
  87. type name
  88. union
  89. unsigned
  90. using 
  91. virtual
  92. void
  93. volatile
  94. wchar_t
  95. while
  96. xor
  97. xor_eq

Add a Comment

Your email address will not be published.