luthfinzo
luthfinzo

Reputation: 5

How to show all reserved words in C++

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?

Upvotes: 1

Views: 914

Answers (1)

Swift - Friday Pie
Swift - Friday Pie

Reputation: 14688

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.

Upvotes: 5

Related Questions