In python, we can type help("Keywords") on IDE to show all reserved words, but, can i type a command same as like that to show all reserved words in C++, or what should i do?
-
8No, there is no such thing. But depending on your IDE there may be some integrated help function. What about googling _c++ keywords_? – Jabberwocky Aug 04 '21 at 06:57
-
2Maybe [this page](https://en.cppreference.com/w/cpp/keyword) might help. – Ruks Aug 04 '21 at 06:58
-
You can write your own help function by detecting all the keywords. :) – Kemal Bayram Aug 04 '21 at 07:04
-
@Jabberwocky: May be he doesn't have internet access :P except SO. – Sreeraj Chundayil Aug 04 '21 at 07:12
-
@InQusitive agreed, i dont understand why people ask on SO before researching. typing text in the google search bar is wayyy easier than asking a question in SO – I_love_vegetables Aug 04 '21 at 07:30
-
I am wondering, if this feature is made inbuilt to C++, does it help developer in someway? – Sreeraj Chundayil Aug 04 '21 at 07:32
-
@InQusitive C++ is a language spec for a compiler. Python is an environment (kinda like powershell), where you can run instructions directly. I don't see how it may help. There were attempts to make shell based on C language before, it just ended with fact that some modern Unix shells have very similar syntax :P – Swift - Friday Pie Aug 04 '21 at 07:43
1 Answers
C++ doesn't have a designated, "native" IDE like Python interpreter does, so unless you have some IDE or plugin targeting C++, you won't get such functionality. What C++ have is a standard on language, required to be supported by various compilers to be considered "compliant" and there are many of them ( I can think of 8 big names off top of my head). Essentially C++ got an official collective authority, Python doesn't.
Multiple IDEs and edit-time static checkers (e.g. Resharper and IntelliSense for MS Visual Studio) support highlighting and syntax analysis along with early error detection.
C++ reserved words: https://en.cppreference.com/w/cpp/keyword
Reserved words is wider class than keywords in C and C++, reserved words include "identifiers with special meaning". Difference is that you able use special identifiers as id if it is possible contextually, albeit it's not recommended. And there are also reserved names, usage of which would be an Undefined Behavior. And there is standard library components, names from which aren't recommended either because possible conflicts. Just mechanical display of reserved word list is not enough.

- 12,777
- 2
- 19
- 42
-
Also keep an eye out for [What are the rules about using an underscore in a C++ identifier?](https://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-underscore-in-a-c-identifier) – user4581301 Aug 04 '21 at 16:27