By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,148 Members | 1,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,148 IT Pros & Developers. It's quick & easy.

Functions having same name return different type values in subclasses.

P: n/a
I want to declare a function F() in a class, which has two children A
and B. I need A.func() return int and B.func() return double. How can
I do that? The F() in parent can be empty or virtual, I just need the
declaration. No implementation is required.

Nov 1 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
syang8 wrote:
I want to declare a function F() in a class, which has two children A
and B. I need A.func() return int and B.func() return double. How can
I do that? The F() in parent can be empty or virtual, I just need the
declaration. No implementation is required.
Don't declare it in the base class.

Ben
Nov 1 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.