Google, tried to guess, read their cribs - did not find. Does NetBeans really not know how?

  • What do you have in mind? Where to look? In the debugger? - VisioN
  • Well, this is the usual feature of any normal IDE in my opinion. For example, in CLion, we hover over a variable (even if it is auto), press Ctr + Q, see the documentation and (!) Type, for example std :: string. In IDEA, the same is true for Scala and Java, only it is possible without documentation, even, Alt + =, looks like this i.imgur.com/rY2hOtJ.png Not in the debugger, just in the editor. How to do this in NetBeans did not find. - Aleksander Alekseev
  • one
    It is necessary to recognize that the best support for C ++ is now only in QtCreator and Visual Studio, CLion is not yet a competitor, in other editors there is support for a tick. - zenden2k
  • Zenden2k, I'm sorry, but what exactly do you miss in CLion? And, to tell you the truth, in QtCreator I also did not find a mapping of variable types. In fact, he does not show documentation at all. - Aleksander Alekseev

2 answers 2

NetBeans does not support variable type mapping.

There is a workaround if you are under the debugger. Add a watch to read:

typeid(yourVariableNameHere).__name 

... and you get the type of the variable. If you have a pointer, then to get a real type of object, the pointer will have to be dereferenced.

For this to work, you will need to include the header file:

 #include <typeinfo> 

PS Yes, everything is so sad. Use normal development environments.

  • Thank. What do you use? Under Linux, CLion seems to be the most normal option at the moment. - Aleksander Alekseev
  • @afiskon Visual Studio, once upon a time C ++ Builder. :) For Linux I did not write on the pros. The most promising is CLion, JetBrains know their stuff. - Athari

Of course, NetBeans can display type information.

  1. Just move the cursor with the Ctrl key on anything. A hint will pop up in which there will be a type
  2. You can open Window -> IDE Tools -> C / C ++ Documentation. This is where documentation from the current context will just appear (for the element on which the cursor is)

Works on any identifiers. Even if the type is auto.