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

What is a friend function in c++?

1477


Difference between declaration and definition of a variable.

1080


Explain what data encapsulation is in c++?

1032


How to declare a function pointer?

952


What is the use of string in c++?

977


Mention the ways in which parameterized can be invoked. Give an example of each.

1003


What are 2 ways of exporting a function from a dll?

1115


How do you establish an is-a relationship?

1077


What does int * mean in c++?

1165


Explain terminate() and unexpected() function?

1036


Is c# written in c++?

923


What are static member functions?

1045


What is the history of c++?

998


Can a new be used in place of old mallocq? If yes, why?

1038


By using c++ with an example describe linked list?

979