Samsung Interview Question
Software Engineer / DevelopersCountry: -
Interview Type: In-Person
Its simple.
C :Static Polymorphism or Overloading;
C++ :Dynamic Polymorphism.
Implementing dynamic polymorphism in C is like reinventing the wheel (C++ features). If there is a concept, both C, C++ are powerful enough to implement it.
But a simple anwer would be: "No, dynamic polymorphism is not there in C, thats why the world moved to C++."
I think, strictly speaking, that the answer is "yes, it's possible, but you'd have to make your own implementation of it, because it's not directly supported."
It's not directly supported, but you could make your own implementation using function pointers.
- Anonymous October 09, 2011