我正在使用此声明移植标头:
struct tMaterialInfo {
char strName[255]; // the texture name
char strFile [255]; // the texture
BYTE color [3]; // the color of the object
};
标题包含以下内容:
#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>
BYTE来自哪里?
我猜这是来自Windows。
一个字节(8位)。
此类型在WinDef.h中声明如下:
typedef unsigned char BYTE;
如果您正在为Windows编程C,我假设您正在使用Visual Studio进行开发。您可以右键单击任何关键字,然后选择转到定义F12以查找其定义位置。
BYTE在WinDef.h中定义
typedef unsigned char BYTE;
几乎可以肯定来自windows.h
的众多标题之一。 Windows SDK包含了typedef
,BYTE
和WORD
的DWORD
s,因为至少Windows 2.0天(我记得最早的Windows SDK)。