Iam running into a problem when using classes and inheritance.
I have a base class which contains a member function whos job it is to create and intialize some variables that are shared between other classes. The other classes are inherited from the base class and the variables are accessable from all the classes however i thought that when i called the member function from the base class at the begining of my program that the variables would still be initialised when i use them in other classes but this is obviously not the case , can somebody please set me straight on how to fix this problem , thanks.
Jump to Post
Can you post a short code example of what you're doing?
All 7 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.