• C

LPTSTR

hi, could someone please explain - LPTSTR.
why,

 LPTSTR ptr;

and not...

 LPTSTR *ptr

a full explanation on  LPTSTR and how to
use it  would be greatly apriciated.

thanks..
mikem_2auAsked:
Who is Participating?
 
Jaime OlivaresSoftware ArchitectCommented:
Sorry, there is a typo:

LPTSTR is equivalent in fact to:
typedef TCHAR *LPTSTR;

And LPCTSTR (constant pointer) is equivalent to:
typedef const TCHAR * LPCTSTR;
0
 
Jaime OlivaresSoftware ArchitectCommented:
LPTSTR is a pointer type, a pointer to a string, or an array of TCHAR to be precise.
Depending of implementation, it can point to a ANSI or Unicode string.

You must not use LPTSTR * because it is a pointer itself:

typedef TCHAR * LPCTSTR;


0
 
Jaime OlivaresSoftware ArchitectCommented:
Some complementary information here:
http://www.codetools.com/string/tconvert.asp
0
 
mikem_2auAuthor Commented:
thankyou for clearing that up for me.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.