@2kaud
Thank you for answer i changed *i to i->second but now it shows me second issue which you told.
Kindly tell me how i can made this code polymorphic?
I want to check whether stored object is Saving class object or Current class object?
Printable View
@2kaud
Thank you for answer i changed *i to i->second but now it shows me second issue which you told.
Kindly tell me how i can made this code polymorphic?
I want to check whether stored object is Saving class object or Current class object?
Have you read about/understand Polymorphic classes and how they are implemented using virtual class functions?Quote:
Kindly tell me how i can made this code polymorphic?
See http://www.learncpp.com/cpp-tutorial...ual-functions/
I've had a quick look at some of the other code and there are big problems. eg
is a big no-no as sb only exists during the lifetime of the block so its address can't be used outside! To do something like this you need to create sb dynamically using new (shared_ptr?) and then delete the memory when not needed.Code:Saving sb;
int no = sb.create();
....
data[no] = &sb;