In WinAPI data types, LPSTR, LPCSTR, LPWSTR, LPCWSTR specific What is the difference?

Category: C/C++ -> C Author: tienan2009110 Date: 2008-10-29 09:56:27
 
tienan2009110
2008-10-29 09:56:27
In WinAPI data types, LPSTR, LPCSTR, LPWSTR, LPCWSTR specific What is the difference?
their corresponding standard C / C + + data type is what?
can explain what?
gkwcjy
2008-10-29 10:10:21
LPCSTR A 32-bit pointer to a constant character string.

LPSTR A 32-bit ; pointer to a character string.

LPCWSTR Pointer to a constant null-terminated string of 16-bit Unicode characters. For more ; information, seeCharacter Sets Used By Fonts

LPWSTR Pointer to a null-terminated string of 16-bit Unicode characters. For ; more information, seeCharacter Sets Used By Fonts.
bai321ye
2008-10-29 10:27:27
LPSTR A 32-bit pointer to a character string.
LPCSTR A 32-bit pointer to a constant character string.

LPSTR a 32-bit pointer to a string
LPCSTR a 32 string constant pointer pointing
LPWSTR a 32 unicode string pointer pointing
LPCWSTR 32-bit unicode string constant pointer pointing

front L represents LONG, P is a pointer mean, C is a constant mean
W is a wide meaning, STR is the string mean

specific definitions refer to the header file

xzf2822557
2008-10-29 10:44:41
in winnt.h
xiaomantou2000
2008-10-29 11:04:03
place in a statement by "F12" came out
bbbbldq
2008-10-29 11:16:25
typedef char * LPSTR;
typedef const char * LPCSTR;
typedef w_char * LPWSTR;
typedef char w_char * LPCWSTR;
dunazo
2008-10-29 11:32:40
C, which means there is a const string can not be modified without the C string
have a different unicode string W is the width force two bytes, no W is ascii string width 1 byte
glj159000
2008-10-29 11:50:54
In short, all point to a string, the difference is: C = CONST, W = WIDE (expressed Double Byte Character System)
appletree5021
2008-10-29 11:53:07
/ /
/ / Basics
/ /

# ifndef VOID
# define VOID void
typedef char CHAR;
typedef short SHORT;
typedef long LONG;
# endif

/ /
/ / UNICODE (Wide Character) types
/ /

# ifndef _MAC
typedef wchar_t WCHAR; / / wc, 16 - bit UNICODE character
# else
/ / some Macintosh compilers don't define wchar_t in a convenient location, or define it as ; a char
typedef unsigned short WCHAR; / / wc, 16-bit UNICODE character
# endif

typedef WCHAR * PWCHAR;
typedef WCHAR * LPWCH, * PWCH;
typedef CONST WCHAR * LPCWCH, * PCWCH;
typedef WCHAR * NWPSTR;
typedef WCHAR * LPWSTR, * PWSTR;

typedef CONST WCHAR * LPCWSTR, * PCWSTR;

/ /
/ / ANSI (Multi-byte Character) types
/ /
typedef CHAR * PCHAR;
typedef CHAR * LPCH, * PCH;

typedef CONST CHAR * LPCCH, * PCCH;
typedef CHAR * NPSTR;
typedef CHAR ; * LPSTR, * PSTR;
typedef CONST CHAR * LPCSTR, * PCSTR;

/ /
/ / Neutral ANSI / UNICODE ; types and macros
/ /
# ifdef UNICODE ; / / r_winnt

# ifndef _TCHAR_DEFINED
typedef WCHAR TCHAR, * PTCHAR;
typedef ; WCHAR TBYTE, * PTBYTE;
# define _TCHAR_DEFINED
# endif / *! _TCHAR_DEFINED * /

====== He let him =========================================
Strong Strong , breeze whisk hill; let him cross his cross, the moon shines river.
cds8238238823ppp
2008-10-29 12:00:24
just look up MSDN
netsion888
2008-10-29 12:12:52
in programming time by pressing 'F1' view Microsoft's help very convenient, select the method or property you want to view, type ah, and then press F1 on ok! However, you have to install the msdn Oh! :)
evers298
2008-10-29 12:20:26
come late is the way myself
wohentianxiaofwfwfw
2008-10-29 12:30:21
header file which is not just defined? ? ?
windy8888
2008-10-29 12:42:48
see if it is in windows.h in