Joao Vilaca Joao Vilaca - 24 days ago 25
C Question

C library vs WinApi

Many of the standard c library (fwrite, memset, malloc) functions have direct equivalents in the windows API (WriteFile, FillMemory/ ZeroMemory, GlobalAlloc).

Apart from portability issues, what should be used, the CLIB or windows API functions?

Will the C functions call the winapi functions or is it the other way around?

thanks for the help

Answer

There's nothing magical about the C library. It's just a standardized API for accessing common services from the OS. That means it's implemented on top of the OS, using the API's provided by the OS.

Use whichever makes sense in your situation. The C library is portable, Win32 isn't. On the other hand, Win32 is often more flexible, and exposes more functionality.

Comments