What are Virtual Functions? How to implement virtual
functions in "C" ?
Answer Posted / jaroosh
To address the second part of the question - the only way to
implement mechanism like virtual functions in C is by using
function pointers, creating structure emulating Virtual
Pointer Table etc.
Implementation is rather complicated and creates a lot of
overhead for every structure that we want to use with
virtual functions (since ANSI C doesnt support inheritance
and polimorphism, it also calls for emulating this behavior,
so virtual functions for C is actually more of a form of art
than anything usefull).
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
How does code-bloating occur in c++?
Explain object slicing in c++?
which of the following is not an secondary constant a) array b) real c) union
What are protected members in c++?
What do you know about near, far and huge pointer?
Does c++ have string data type?
Why do we need templates?
what is C++ objects?
What is the difference between containment and delegation?
What are friend functions in C++?
How are the features of c++ different from c?
What is &x in c++?
write a programme to get a character and thier ASCII value
How do you declare a set in c++?
What is near, far and huge pointers? How many bytes are occupied by them?