is this possible to get all the variables and methods of a class at runtime? if yes then how? I did this in C# using Reflection. but now i am working in C++.
There is no way to do what you are asking in C++. As suggested in the other answer, RTTI can help you, but is probably not what you need.
If you describe in more details what you are trying to do and why you need reflection, we can probably suggest other solutions in C++.
You can use RTTI in C++.
This is just an opinion: It's not as easy/straighforward as C#'s reflection API.
Also check out this SO question.
While you can determine the type of an object using RTTI, C++ is not fully reflective and you cannot take a normal C++ class and determine what methods or variables it has.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With