0

I have this code:

enum type{FOO, BAR}

class base{
    funct(type t);
}
class other : base{
    funct(type t);
}

int main(){
    base x;
    x = other();
    x-funct(FOO); //This call base::funct()
}

Always call to base function, i dont get it.

sr_soto
  • 23
  • 3
  • i try also with virtual and override but... nothing – sr_soto Nov 26 '15 at 04:19
  • Try to use **references** and virtual functions, and you'll see it will work. So write something like `other oth; base& x = oth; x->funct(FOO);`, making sure `funct` is marked `virtual`. And also read the duplicate carefully, it explains quite a few useful things. – vsoftco Nov 26 '15 at 04:24
  • Does that even compile? `x-funct(FOO)` doesn't make sense. – skyking Nov 26 '15 at 07:09

0 Answers0