在 java 中,我们可以使用 javap 反汇编器探索 java class 方法。如何在 C++ 中做同样的事情?

In java we can explore a java class, methods by using javap disassembeler. how to do the same in c++?

我是这个社区的新手,所以,如果我在错误的部分提出这个问题而违反了我们社区的任何条款和条件,那么我很抱歉。 我一直在寻找上述问题的答案,但 none 的结果是相关的。

你的主要问题是给定一个可执行文件(c++程序的输出)你能找到成员、函数等是什么吗

在 C++ 中是不可能的。

C++ 可执行文件包含本机汇编代码。
在 Java 中,class 文件实际上包含字节码。

I just wanna know that in java we were able to explore a java class methods by using javap, how to do the same in c++ ???

你真的得不到任何有用的东西。对于 C++ 程序集,您能得到的最好的是错位的名称。 Java把一个class的所有方法签名都存放在.class文件中,所以可以引用和参考。但是 C++ 编译为汇编,并且适用于内存地址和堆栈以及其他较低级别的东西。

Suppose, I wanted to see all the methods of String class in java, I would have used javap by which all its methods, their return type, their number of arguments & their data type etc, are displayed. How to do the same in c++ ???

或者您可以阅读该库的文档。您可以对 C++ 库执行相同的操作:阅读文档。这就是它的用途。或者通读库的头文件,因为每个 C++ 库都有。

Also is there a command line way to explore what all packages & classes are there in a particular package in java language ???

对于Java,您之前提到了javap。给你:)

对于 C++,这实际上取决于您使用的编译器工具链。例如,Microsoft Visual C++ 具有 dumpbin CLI 工具,可以提供非常丰富的信息。但同样,您只能得到损坏的名称,这可能反映也可能不反映程序使用的名称空间和 classes 的结构。

Suppose java** java.awt.* or any such method to know all the packages & classes inside a particular package.

...

大部分信息(方法、classes、命名空间(或 Java 中的包))可以从相关库的任何文档中了解。如果您需要源代码,那么您可以免费获得它(对于开源项目),从库供应商处购买(对于闭源项目),或者只是凑合使用文档。