What are C++ Keywords? Set of 59 keywords in C ++

What are C++ Keywords?

The words (tokens) that convey a specific meaning to the language compiler are called keywords. These are also known as reserved words as they are reserved by the language for special purposes and cannot be redefined for any other purposes.

C++ Keywords List

The set of 59 keywords in C ++ are listed in Table. Their meaning will be explained in due course:

  1. Asm: To declare that a block of code is to be passed to the assembler.

  2. Auto: A storage class specifier that is used to define objects in a block.

  3. Bool: Boolean false-true type that can hold either the false or true literals.

  4. Break: Terminates a swi tch statement or a loop.

  5. Case: Used specifically within a swi tch statement to specify a match for the statement’s expression.

  6. Catch: Specifies actions taken when an exception occurs.

  7. Char: Fundamental data type that defines character objects.

  8. Class: To declare a user-defined type that encapsulates data members and operations or member functions.

  9. Const: To define objects whose value will not alter throughout the lifetime of program execution.

  10. Continue: Transfers control to the start of a loop.

  11. Default: Handles expression values in a swi tch statement that are not handled by case.

  12. Delete: Memory deallocation operator.

  13. Do: Indicates the start of a do-whil.e statement in which the sub-statement is executed repeatedly until the value of the expression is logical-false.

  14. Double: Fundamental data type used to define a floating-point number.

  15. Else: Used specifically in if-el.se statement.

  16. Enum: To declare a user-defined enumeration data type.

  17. Explicit: To declare an explicit constructor.

  18. Export: Allows a template definition to be accessible from another translation unit.

  19. Extern: An identifier specified as extern has external linkage to the block.

  20. False: Boolean literal of value zero.

  21. Float: Fundamental data type used to define a floating-point number.

  22. For: Indicates the start of a for statement to achieve repetitive control.

  23. Friend: A class or operation whose implementation can access the private data members of a class.

  24. Goto: Transfer control to a specified label.

  25. If: Indicate start of an if statement to achieve selective control.

  26. Inline: A function specifier that indicates to the compiler that inline substitution of the function body is to be preferred to the usual function call implementation.

  27. Int: Fundamental data type used to define integer objects.

  28. Long: A data type modifier that defines a 32-bit int or an extended double.

  29. Mutable: Allows an object member to override constness.

  30. Namespace: Defines a scope.

  31. New: Memory allocation operator.

  32. Operator: Overloads a c++ operator with a new declaration.

  33. Private: Declares class members which are not visible outside the class.

  34. Protected: Declares class members which are private except to derived classes.

  35. Public: Declares class members which are visible outside the class.

  36. Register: A storage class specifier that is an auto specifier, but which also indicates to the compiler that an object will be frequently used and should therefore be kept in a register.

  37. Return: Returns an object to a function’s caller.

  38. Short: A data type modifier that defines a 16-bit int number.

  39. Signed: A data type modifier that indicates an object’s sign is to be stored in the high-order bit.

  40. Sizeof: Returns the size of an object in bytes.

  41. Static: The lifetime of an object defined static exists throughout the lifetime of program execution.

  42. Struct: To declare new types that encapsulate both data and member functions.

  43. Switch: Switch statement.

  44. Template: Parametrised or generic type.

  45. This: A class pointer which points to an object or instance of the class.

  46. Throw: Generate an exception.

  47. True: Boolean literal of value one.

  48. Try: Indicates start of a block of exception handlers.

  49. Typedef: Synonym for another integral or user-defined type.

  50. Typeid: The typeid () operator returns the type of its operand.

  51. Typename: Within a template typename indicates that a qualified name denotes a type.

  52. Union: Similar to a structure, struct, in that it can hold different types of data, but a union can hold only one of its members at a given time.

  53. Unsigned: A data type modifier that indicates the high-order bit is to be used for an object.

  54. Using: using declaration and using directive.

  55. Virtual: A function specifier that declares a member function of a class which will be redefined by a derived class.

  56. Void: Absent of a type or function parameter list.

  57. Volatile: Define an object which may vary in value in a way that is undetectable to the compiler.

  58. Wchar_t: Wide character type.

  59. While: Start of a while statement and end of a do-while statement.

Leave a Reply