3 ms·
With the Win32 API, we saw some innovative use of C in action, such as the function pointers and the callback functions.
by aurora72 12y ago
With the Win32 API, we saw some innovative use of C in action, such as the function pointers and the callback functions.
- Jare 12y agoI was using C function pointers routinely in 1991, way before I ever touched Windows. It was a straightforward thing to do after using them in assembly language throughout the 80s.
- goalieca 12y agoWhat? Checkout the signature for the posix signal function. Notice the function pointer? http://man7.org/linux/man-pages/man2/signal.2.html http://man7.org/linux/man-pages/man2/signal.2.html "Signals have been around since the 1970s Bell Labs Unix and have been more recently specified in the POSIX standard." --wikipedia Basically, they're a software interrupt handler. Not too different from assembly. I don't see why that would be innovative at all? In fact, early C++ just compiled to C. You can write structs with function pointers and vtables all in C if you wanted. People have been doing that since the 80s.
- gryph0n 12y agoForget the Posix/Win32 platforms, function pointers can be easily found in the Standard C library itself. I believe there are atleast 2 functions taking function pointers as parameters: 1.>'qsort' function takes a function pointer to decide how to compare your data in order to sort it, presumably using quick sort. 2.>'signal' function has a Posix origin, but it did manage to make it into the C standard. It takes a function pointer to decide which function to call on getting a particular signal.