Reputation:
How can I create a pointer to a class. I assume, that classes exists somewhere in RAM, so, is it possible to get a pointer to it?
I don't mean a pointer to an object, I mean a pointer to the class itself (like a function pointer).
Upvotes: 9
Views: 1084
Reputation: 179779
This is not possible. C++ has three types of pointers:
Classes are none of the above.
Upvotes: 4
Reputation: 136208
I assume, that classes exist somewhere in the Ram
Classes do not exist at run-time, so you cannot take a pointer to a class.
Only objects exist at run-time.
Upvotes: 13