哪个 C/C++ 头文件定义了 BYTE 数据类型?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4486140/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Which C/C++ header file defines a BYTE data type?
提问by andandandand
I'm porting a header with this declaration:
我正在移植带有此声明的标头:
struct tMaterialInfo {
char strName[255]; // the texture name
char strFile [255]; // the texture
BYTE color [3]; // the color of the object
};
The header has the following includes:
标题包含以下内容:
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <fstream>
#include <vector>
#include <gl\gl.h> // Header File For The OpenGL32 Library
#include<gl\glu.h>// Header File For The GLu32 Library
#include <gl\glaux.h>
Where does that BYTE come from?
那个 BYTE 来自哪里?
回答by dsolimano
回答by andandandand
If you are programming C for Windows I assume you are using Visual Studioto develop. You can right clickon any keyword and select Go To DefinitionF12to find where it is defined.
如果您正在为 Windows 编程 C,我假设您正在使用Visual Studio进行开发。您可以右键单击任何关键字并选择转到定义F12以查找其定义位置。
BYTE is defined in WinDef.h
BYTE 在 WinDef.h 中定义
typedef unsigned char BYTE;
回答by RBerteig
Almost certainly from one of the many headers included from windows.h
. The Windows SDK has included typedef
s for BYTE
, WORD
, and DWORD
since at least Windows 2.0 days (the earliest Windows SDK I recall having).
几乎可以肯定来自windows.h
. Windows SDK 已经包含typedef
了BYTE
、WORD
和 的s ,DWORD
至少从 Windows 2.0 天开始(我记得最早的 Windows SDK)。