Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


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

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.

 

 

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