View Single Post
Re: need a 2nd pair of eyes for c++ inheritance problem
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: need a 2nd pair of eyes for c++ inheritance problem - 22-03-2004

IMO this is not an inheritance problem because your classes are inheritated fine from each other, but I think the problem comes that you can't assimilate a child class to its parent when trying to pass an instance of it as a parameter to the Sort() function. You'd better write overloaded versions of Sort() that would feature the parameter types you want and let the compiler link against the right one.

Other than that I don't know what a "Sort ((Sortable **) table, 20)" would give...

I'm not a big C++ guy anyway.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote