devxlogo

Win32 Equivalents for C Runtime Functions

Win32 Equivalents for C Runtime Functions

Many of the C runtime functions have direct equivalents in the Win32 application programming interface (API). However, when you use C-Runtime functions, you need to have C-Runtime startup code and this could increase the size of your applications or DLLs. Instead, you can use those Win32 API functions to perform the same tasks and they don’t require any start up code thereby reducing the size of your Applications or DLLs. Here’s some examples:
Buffer Manipulation:

   memcpy  --> CopyMemory  memmove --> MoveMemory  memset  --> FillMemory, ZeroMemory

size=3>
Character Classification:

   isalnum -> IsCharAlphaNumeric  isalpha -> IsCharAlpha, GetStringTypeW (Unicode)  islower -> IsCharLower, GetStringTypeW (Unicode)  tolower -> CharLower  toupper -> CharUpper

size=3>
Stream Routines:

   sprintf  -> wsprintf  vsprintf -> wvsprintf

size=3>
String Manipulation:

 strcat, wcscat   -> lstrcat  strcmp, wcscmp   -> lstrcmp  strcpy, wcscpy   -> lstrcpy  _strupr, _wcsupr -> CharUpper, CharUpperBuffer

size=3>
These are just some popular C-Runtime functions that have equivalencies in the Win32 API.

devx-admin

Share the Post: