Search code examples
c++keywordreserved-words

Difference between reserved words and keywords?


What are the differences between reserved words and keywords in C++?

Is 'main' a reserved word or a keyword?


Solution

  • The only thing I could think of that might differentiate the two is if a word was reserved for future use (i.e. not a keyword, but also not allowed for use). However, I couldn't think of an exapmle off the top of my head...

    Main is not a keyword per se, but it is usually required by C, C++, C#, and similar languages as the beginning execution point of your app. These langauges each define the role of main in the corresponding language specification.