为什么 Windows API 中的所有内容都是 typedef 的? [英] Why is everything in the Windows API typedef'd?
本文介绍了为什么 Windows API 中的所有内容都是 typedef 的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
更具体地说,为什么在许多情况下 typedef
会使用多个不同的名称,为什么 typedef
指针类型(有时会混淆逻辑)?>
例如:
typedef const WCHAR *LPCWSTR, *PCWSTR;
这样做有什么意义?
解决方案
PCWSTR 和 LPCWSTR 之所以同时存在,是因为在古代是有区别的.LPCWSTR 曾经是 const WCHAR FAR *.
More specifically, why is the same thing typedef
'd with multiple different names in many cases, and why typedef
pointer types (obscuring logic at times)?
For example:
typedef const WCHAR *LPCWSTR, *PCWSTR;
What is the point of that?
解决方案
The reason there is both PCWSTR and LPCWSTR is that in ancient times there was a difference. LPCWSTR used to be const WCHAR FAR *.
这篇关于为什么 Windows API 中的所有内容都是 typedef 的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文