I want to run polymorphism in C any one can help me.
Is it possible to run a polymorphism in C.
Collapse
X
-
Polymorphism can be implemented in C by using function pointers. You will need to manage these pointers by yourself. C++ would do this for you so unless there is some technical reason you need to do this in C, you are really wasting a lot of your time re-creating code generated by a C++ compiler.
I suggest you learn C++ polymorphism to see how C++ does it. Then just make your own C implementation that works for you.
This is a nice exercise if you are a student. If this is for a real job, use C++.
Comment