I would like to save my object name as a string. May I explain using a few lines of code.
#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
class Example
{
public:
string object_name;
//code...
};
int main()
{
Example object;
cout<<object.object_name<<endl; //In this case the output should be "object", how to achieve this ?
return 0;
}