Thread: 1 error
View Single Post
Old 05-30-2009, 08:28 AM   #5 (permalink)
shuuhen
Manager
 
shuuhen's Avatar
 
Join Date: Sep 2004
Location: Colorado
Posts: 987
OS: Mac OS 9.1, Mac OS X 10.5.8, WinXP Pro, FreeBSD 6.0, Gentoo Linux

My System

Re: 1 error

I'm guessing you are assuming that Secretary would inherit the constructors from Employee? This is not exactly what happens. If a derrived class does not have any constructors, the complier will generate one. Since Secretary has a constructor, you'll need to specify any other constructors.

Just wondering, why have conio.h? It doesn't appear to be used. Also, any reason you're using "#include <iostream.h>" (deprecated) instead of "#include <iostream>" (current)?


@jamiemac2005: The Secretary method is a constructor, so it does not have a return type.

@TheOutcaste: The declaration of the Secretary variable would implicitly call a constructor with no arguments. It fails since that constructor is not defined.
__________________


Has it been a few days since I replied to your thread? Don't panic! I'm a busy college student and may forget a post if I'm extra busy (or it might just take me a while to be able to do a decent reply). If you still need help and are awaiting my reply after a few days, PM me about it.

When posting what errors you get, please give the full message. It makes helping you much easier.
shuuhen is offline   Reply With Quote