• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

Virtual functions

Hi,

Please consider a class

class XYZ{
...
virtual fnSomefunction(int);
}

class DER : public XYZ{
fnSomefunction(int);
fnSomefunction(int,int);
}

When I try to compile the above, I get an error related to the overloaded function. Cant I oveload a function which has been defined in he base class?

If so, then what is the reason?

Regards

Shayad.

0
shayad
Asked:
shayad
  • 2
1 Solution
 
jhanceCommented:
So what's the error?  I don't see any problem with what you've posted above.
0
 
GlennDeanCommented:
  Shayad:
I tried the above on my compiler and it works just great.  By any chance are you getting a "No overloaded constructor" error?
     Glenn
0
 
freshmeatCommented:
just have a try about class XYZ:

Class XYZ{
....
virtual fnSomefunction( )=0;
}


good luck
:)
0
 
freshmeatCommented:
what is the answer???
who should get the points?

0

Featured Post

Will You Be GDPR Compliant by 5/28/2018?

GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now