• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3040
  • Last Modified:


hi, could someone please explain - LPTSTR.

 LPTSTR ptr;

and not...

 LPTSTR *ptr

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

  • 3
1 Solution
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;

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;
Jaime OlivaresSoftware ArchitectCommented:
Some complementary information here:
mikem_2auAuthor Commented:
thankyou for clearing that up for me.
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.

Join & Write a Comment

Featured Post

Will You Be GDPR Compliant by 5/28/2018?

GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now