Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How does code-bloating occur in c++?

1207


Explain object slicing in c++?

1061


which of the following is not an secondary constant a) array b) real c) union

1806


What are protected members in c++?

1136


What do you know about near, far and huge pointer?

1143


Does c++ have string data type?

1112


Why do we need templates?

993


what is C++ objects?

1198


What is the difference between containment and delegation?

1336


What are friend functions in C++?

1067


How are the features of c++ different from c?

1107


What is &x in c++?

1005


write a programme to get a character and thier ASCII value

3049


How do you declare a set in c++?

958


What is near, far and huge pointers? How many bytes are occupied by them?

1121