View previous topic :: View next topic |
Author |
Message |
24quant42 Cheater
Reputation: 0
Joined: 19 Apr 2023 Posts: 31
|
Posted: Fri Jul 14, 2023 8:09 am Post subject: Who uses Structure dissect, he knows that in the field point |
|
|
Who uses Structure dissect, he knows that in the field pointer to the object we see a description like.
"Pointer to instance of <ClassName>".
The question is, how does the CE map the ClassName? and how can i get the class name in c++ language?
My problem is that I found the address of the array in memory, where a bunch of different objects are stored, of which I need only certain ones.
I wanted to get the class names and then filter them
|
|
Back to top |
|
 |
Csimbi I post too much
Reputation: 97
Joined: 14 Jul 2007 Posts: 3325
|
Posted: Fri Jul 14, 2023 1:50 pm Post subject: |
|
|
Read up on RTTI
|
|
Back to top |
|
 |
HalfWolf Newbie cheater
Reputation: 0
Joined: 03 Jan 2023 Posts: 12
|
Posted: Mon Jul 17, 2023 10:26 pm Post subject: |
|
|
In C++, you can obtain the class name using the typeid operator from the <typeinfo> library. Here's an example:
cpp
Copy code
#include <iostream>
#include <typeinfo>
class MyClass {
// Class definition
};
int main() {
MyClass obj;
const std::type_info& typeInfo = typeid(obj);
std::cout << "Class name: " << typeInfo.name() << std::endl;
return 0;
}
The typeid operator returns a reference to a type_info object that contains information about the type. You can use the name() member function of the type_info class to obtain the class name as a string.
By iterating through your array of objects, you can apply this method to each object and filter out the ones you need based on their class names.
I hope this helps! Let me know if you have any further questions.
|
|
Back to top |
|
 |
|