| |

VerySource

 Forgot password?
 Register
Search
View: 791|Reply: 3

What is the specific meaning of LPCTSTR and LPTSTR, and what is the difference between them? ?

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-9-28 17:30:01
| Show all posts |Read mode
As the title!
Reply

Use magic Report

0

Threads

45

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-9-29 12:00:01
| Show all posts
LZ will find that there is an extra C in the middle
That is const ^_^
Reply

Use magic Report

0

Threads

45

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-9-29 12:15:01
| Show all posts
That is, the front is a constant pointer, the latter is not
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-9-29 13:45:01
| Show all posts
LPCTSTR: An LPCWSTR if UNICODE is defined, an LPCSTR otherwise.

This type is declared in WinNT.h as follows:


#ifdef UNICODE
typedef LPCWSTR LPCTSTR;
#else
typedef LPCSTR LPCTSTR;
#endif

LPTSTR: An LPWSTR if UNICODE is defined, an LPSTR otherwise.
This type is declared in WinNT.h as follows:


#ifdef UNICODE
typedef LPWSTR LPTSTR;
#else
typedef LPSTR LPTSTR;
#endif

LPCSTR: Pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters.

LPSTR: Pointer to a null-terminated string of 8-bit Windows (ANSI) characters.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list