Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Home » Tip Bank » C++
Language: C++
Expertise: Advanced
Aug 27, 2001



Building the Right Environment to Support AI, Machine Learning and Deep Learning

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

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

Stream Routines:
  sprintf  -> wsprintf
  vsprintf -> wvsprintf

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

These are just some popular C-Runtime functions that have equivalencies in the Win32 API.
Trong Ha
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date