[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.
Technical Discussion :: C++

10 / 187

Why do we need virtual function?

Answer:

When a function is made virtual, c++ determines which function to use at run-time based on the type of the object pointed to by the base pointer, rather than the type of the pointer. By making the base pointer to point to different objects, we execute different versions of the virtual function.

Asked In ::

Post Your Answer Here:


Rate This: +0 -0     
Report    

Post Your Reply Here:

Alert me
q4i-reply-your-answer

Report Error

Please Login First Click Here

Most Popular Qs.