logo CBCE Skill INDIA

Welcome to CBCE Skill INDIA. An ISO 9001:2015 Certified Autonomous Body | Best Quality Computer and Skills Training Provider Organization. Established Under Indian Trust Act 1882, Govt. of India. Identity No. - IV-190200628, and registered under NITI Aayog Govt. of India. Identity No. - WB/2023/0344555. Also registered under Ministry of Micro, Small & Medium Enterprises - MSME (Govt. of India). Registration Number - UDYAM-WB-06-0031863

Keywords Available in Both C and C++!


Keywords Available in Both C and C++

C and C++ share a set of keywords since C++ was initially designed as an extension of the C language. Here are the keywords available in both C and C++:

 

  1. auto: Specifies automatic storage duration for a variable.
  2. break: Terminates the execution of a loop or switch statement.
  3. case: Labels a statement within a switch statement.
  4. char: Defines a character data type.
  5. const: Specifies that a variable's value cannot be modified.
  6. continue: Skips the current iteration of a loop and proceeds to the next iteration.
  7. default: Specifies the default case in a switch statement.
  8. do: Initiates a do-while loop.
  9. double: Defines a double-precision floating-point data type.
  10. else: Specifies the alternative condition in an if statement.
  11. enum: Declares an enumeration type.
  12. extern: Specifies external linkage for a variable or function.
  13. float: Defines a single-precision floating-point data type.
  14. for: Initiates a for loop.
  15. goto: Transfers control to a labeled statement.
  16. if: Initiates an if statement.
  17. int: Defines an integer data type.
  18. long: Defines a long integer data type.
  19. register: Suggests to the compiler to store a variable in a register.
  20. return: Returns a value from a function.
  21. short: Defines a short integer data type.
  22. signed: Specifies signed integer types.
  23. sizeof: Returns the size of a data type or variable.
  24. static: Specifies static storage duration for a variable or function.
  25. struct: Defines a structure type.
  26. switch: Initiates a switch statement.
  27. typedef: Creates an alias for a data type.
  28. union: Defines a union type.
  29. unsigned: Specifies unsigned integer types.
  30. void: Specifies an empty or incomplete data type.
  31. volatile: Indicates that a variable may be modified by external factors.
  32. while: Initiates a while loop.

 

These keywords are part of the core syntax and semantics shared by both C and C++, allowing developers to write code that is compatible with both languages. However, while these keywords are common, there are differences in the way some features are implemented or used between C and C++.

 

Thank you,


Give us your feedback!

Your email address will not be published. Required fields are marked *
0 Comments Write Comment