Is it possible to get the object name too?
#include
class one {
public:
int no_of_students;
one() { no_of_students = 0; }
void new
use typeid(class).name
// illustratory code assuming all includes/namespaces etc
#include
#include
using namespace std;
struct A{};
int main(){
cout << typeid(A).name();
}
It is important to remember that this gives an implementation defined names.
As far as I know, there is no way to get the name of the object at run time reliably e.g. 'A' in your code.
EDIT 2:
#include
#include
#include