0
Answer

Array of pointers to member variables?

petecjohnson

petecjohnson

19y
1.7k
1
Hi I have several classes that have basically the same code: they assign the contents of a datareader to the member variables in the class. I want to put this code into a generic super class but to do this I would need some way of assigning to the member variables of the sub class without knowing their names. If I could create an array in the sub class to store pointers to the member variables then in the super class I could enumerate through the array and through the datareader to make the assignments. I don't want to use unmanaged code really. Is there a way (or another way) of doing this ?