Dynamic method dispatching in C
问题 I know it sounds silly and I know that C is not an Object Oriented Language. But is there any way that dynamic method dispatching can be achieved in C? I thought about function pointers but don't get the entire idea. How could I implement this? 回答1: As others have noted, it is certainly possible to implement this in C. Not only is it possible, it is a fairly common mechanism. The most commonly used example is probably the file descriptor interface in UNIX. A read() call on a file descriptor