Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

huahsin68

What is _T ??

This topic is 5394 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
quote:
Original post by huahsin68
Hi!!

I have a sample here: _T("XXX")

What is the purpose of _T ?
Is it a function?

Thank You @!


It''s a text macro which converts the following character or string to unicode if _UNICODE is defined.



Human beings, by changing the inner attitudes of their minds, can change the outer aspects of their lives.

William James (1842 - 1910)

Share this post


Link to post
Share on other sites
convert to unicode? Why convert to unicode?

Is it for faster transmition process? Or certain computer can''t read the text, so there need to convert to "low level language".

Thank You @!

Share this post


Link to post
Share on other sites
Unicode allows for any reasonable language to be encoded without mucking with string sizes or multi-byte business. Win2K/XP is Unicode natively (though the Win32 API provides ASCII calls, which usually convert to Unicode on entry). _T translates to L if _UNICODE is defined, or nothing if not. C/C++ spec provides that a string that looks like L"I am your daddy" is stored in Unicode-compatible format (16 bits per character).

Similarly, TCHAR is the macro''d version of CHAR/WCHAR. LPCTSTR is the macro''d version of LPCSTR or LPCWSTR.

People should get used to using Unicode. I''m not sure if it''ll ever overtake single-byte character strings, but it''s certainly can''t hurt.

I like pie.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!