Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3230768
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:57:57+00:00 2026-05-17T16:57:57+00:00

Recently, I meet some tasks about the char/string on windows platform. I see that

  • 0

Recently, I meet some tasks about the char/string on windows platform. I see that they are different char type like char, TCHAR, WCHAR, LPSTR, LPWSTR, LPCTSTR. Can someone give me some information about it? And how to use like the regular char and char *. I cam confused about these types?

Best Regards,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:57:58+00:00Added an answer on May 17, 2026 at 4:57 pm

    They are documented on MSDN. Here’s a few:

    • TCHAR: A WCHAR if UNICODE is defined, a CHAR otherwise.
    • WCHAR: A 16-bit Unicode character.
    • CHAR: An 8-bit Windows (ANSI) character.
    • LPTSTR: An LPWSTR if UNICODE is defined, an LPSTR otherwise.
    • LPSTR: A pointer to a null-terminated string of 8-bit Windows (ANSI) characters.
    • LPWSTR: A pointer to a null-terminated string of 16-bit Unicode characters.
    • LPCTSTR: An LPCWSTR if UNICODE is defined, an LPCSTR otherwise.
    • LPCWSTR: A pointer to a constant null-terminated string of 16-bit Unicode characters.
    • LPCSTR: A pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters.

    Note that some of these types map to something different depending on whether UNICODE has been #define‘d. By default, they resolve to the ANSI versions:

    #include <windows.h>
    // LPCTSTR resolves to LPCSTR
    

    When you #define UNICODE before #include <windows.h>, they resolve to the Unicode versions.

    #define UNICODE
    #include <windows.h>
    // LPCTSTR resolves to LPCWSTR
    

    They are in reality typedefs to some fundamental types in the C and C++ language. For example:

    typedef char CHAR;
    typedef wchar_t WCHAR;
    

    On compilers like Visual C++, there’s really no difference between an LPCSTR and a const char* or a LPCWSTR and a const wchar_t* . This might differ between compilers however, which is why these data types exist in the first place!

    It’s sort of like the Windows API equivalent of <cstdint> or <stdint.h>. The Windows API has bindings in other languages, and having data types with a known size is useful, if not required.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently I'm doing some work on RTMP streaming, that is using Flowplayer to integrate
Recently I have been dealing with windows LogonUser API. The LogonUser api returns different
I recently asked about accessing data from SPSS and got some absolutely wonderful help
recently I am reading about Thinking in Java. that code in my PC is
Recently I've been doing some research into SEO and how URIs that use hyphens
I recently meet a problem when copying dynamically allocated data in device to host
Recently, I was writing a class in which I discovered that I could reduce
Recently I've noticed that on occasion I do not get a mayorship notification when
My manager has recently asked my team and I for our input about implementing
Recently, I work on a video player program on Windows for a CCTV program.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.