![]() |
| ||
| Inheritance, and code not running Ah right! Im on my first steps on c++, What Im trying to do is have this "basic node" class wich just take an id and from there usign inheritance make "linked list node" and "binary tree node" classes my code so far looks like this void main() and the other 2 headers //sLink.h link.h //the basic node the compiler error says: (red code position ) 'initializing' : cannot convert from 'Link *' to 'sLink *' Some reason why's ... thanks |
| ||
| Re: Inheritance, and code not running Your problem is actually the first four lines of the main() function. I've added comments to the code that are related to problems on each line. void main() // main should return int, not voidThe only reason the compiler is complaining about the line you have highlighted is that it is the only constructor that might be invoked by your code, but you've provided the wrong type of argument. |
| ||
| Re: Inheritance, and code not running pretty good answer GOT IT ! thx |
| All times are GMT -4. The time now is 1:43 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC