By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,117 Members | 1,093 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,117 IT Pros & Developers. It's quick & easy.

Is it possible to run a polymorphism in C.

P: 1
I want to run polymorphism in C any one can help me.
Oct 11 '10 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 9,197
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++.
Oct 11 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.