?
Solved

LPTSTR

Posted on 2004-10-02
4
Medium Priority
?
3,032 Views
Last Modified: 2008-01-09
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..
0
Comment
Question by:mikem_2au
  • 3
4 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 12209944
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
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 750 total points
ID: 12209954
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
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 12210039
Some complementary information here:
http://www.codetools.com/string/tconvert.asp
0
 

Author Comment

by:mikem_2au
ID: 12210247
thankyou for clearing that up for me.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question