You mean that when you have a class like
class Blabla
{
public :
int x;
int y;
float z;
}
And you would like to get the number of let's say integer member variables in the class, from the code (not by looking at the class definition yourself)?
That's not possible, sorry.
You would have to put the variables to some container, for example vector<int>, then you can get the number of them. But I don't know whether this is possible in your case.
EDIT: I just found your second post and I'm not really clever from it, but it sounds like a vector container could be the right way for you.
class Blabla
{
public :
vector<int> integerVariables;
}
Blabla a;
...
...
cout << a.integerVariables.size(); // writes the number of variables in the container