Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ coding questions for interview

class A{
     public:
          virtual void fun(){
               cout<<"base ";
          }
};
class B: public A{
     public:
          void fun(){
               cout<<"derived ";
          }
};
int main(){
     A *a=new B;
     a->fun();

     return 0;
}
Source by www.interviewbit.com #
 
PREVIOUS NEXT
Tagged: #coding #questions #interview
ADD COMMENT
Topic
Name
1+7 =