lets say i have base class a
and class b is inheriting class a.
in class a we have a function called convert().in convert we create a object of type b.
Is this correct?
It compiles and runs in dev C++..but wanted to know from programming point of view..correct or wrong
Probably wrong, since base classes typically should know nothing about their derived classes, but it may also be the case that you are using b as if it has no inheritance relationship with a. What is convert() supposed to do?