TCHAR和WCHAR有什么区别? [英] What is difference between TCHAR and WCHAR?

查看:104
本文介绍了TCHAR和WCHAR有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打开了winnt.h头文件,发现有两行:

I've opened winnt.h header file and found there this two lines:

typedef wchar_t WCHAR;

typedef WCHAR TCHAR, *PTCHAR;

但在我的帖子,它们之间有一些区别。

but there was comment in one of my posts that there is some difference between them. Then what is the difference?

推荐答案

如果你读完整个标题,你会发现:

If you read the entire header, you will find:

#ifdef _UNICODE
typedef WCHAR TCHAR;
#else
typedef char TCHAR;
#endif

或其他字样。

也许MS已经删除了较晚的选项。

Perhaps MS has removed the narrow option of late.

这篇关于TCHAR和WCHAR有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆