Click to See Complete Forum and Search --> : Implementation of Virtual functions in C#


vikrampschauhan
December 31st, 2004, 02:09 PM
C++ implements virtual functions by using VTables. I learnt that C# doesnt use VTables to implement virtual functions. How are virtual functions implemented in C#?

Thanks
Vikram

darwen
January 1st, 2005, 03:21 AM
No idea. There's nothing in "Applied Microsoft .NET programming" either about the actual implementations.

I don't think it matters. In fact even if it does matter : implementations can vary depending on what version/OS the CLR is executing on.

The point about C# is that everything is an abstraction : you can't assume that just because the Microsoft .NET framework does something some way that it'll be the same with other versions of the framework (e.g. Mono). That breaks the abstraction and is a highly dangerous thing to do.

I must admit I'm starting to get somewhat concerned about the number of questions about the inner workings of the framework.

As I've already said it is s intended as an abstraction and you shouldn't make assumptions about it's inner workings.

Just because it does something one way today who's to say it won't change in the future ?

Darwen.

vikrampschauhan
January 4th, 2005, 06:57 PM
Yes, there are million of different ways in which different compiler versions can implement a particular concept.

I just want to know any one out of the million. Things like what exactly happens when we write new(), or when we set a reference to null, facinate me(I only want to know it on the surface).

I would be grateful if you could point me some forum where I can post these types of questions, if you could suggest me some books or something...

Thanks
Vikram