Solved

LPTSTR

Posted on 2004-10-02
4
3,025 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 250 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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to design, and implement simple interface 5 137
Pointer in one class to member in another 6 125
Read file descriptor 3 in C 14 112
C qsort compare function issue 6 12
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
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.

789 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