Q:

Is Polymorphism possible in C?

Can I include or declare a function inside a structure? I am trying to achieve polymorphism in C. If defining a function isn't the correct way to do it, what other methods can I use?

A:

Polymorphism as a feature of object-oriented languages is not available in C. Neither are encapsulation and inheritance - the language does not have the corresponding features.
This does not mean, however, that it is impossible to model the corresponding behavior with the regular features of C: it is possible to build a library that lets you produce behavior that looks like polymorphism, for example, by using arrays of function pointers.

