🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.program
Article #396

Re: DOS�µ�C++��UNIX�µ�C++�ı�������?

#396
From: Sheep
Date: Wed, 19 Aug 1998 00:00
65 lines
3237 bytes
> ==> A_A(�����۾���һ��)                      ˵��: 
> �ղ���short int, Ȼ��������˵��unsigned short, ������ 
> һ�����������, 2+4+2+2+4=16? ����, �����Ժ���. 
                  ~~~~~~~~~~~~~
                  Ӧ����ΪѰַ���㣬ʹ����
                  �����ʽ��
                  2+XX+4+2+2+4,��ʹ����
                  ˫��Ѱַ���㡣  
> #include <stdio.h> 
> #include <unistd.h> 
> #include <sys/types.h> 
> #include <sys/stat.h> 
> #include <fcntl.h> 
> typedef struct tagBITMAPFILEHEADER {    /* bmfh */ 
>         unsigned short  bfType;
          ~~~~~~~~~~~~~~~~~~~~~~
          unsigned char   bfType[2];  
          �����Ÿij����ϣ���Ϊ16��//sigh
>         unsigned long   bfSize; 
>         unsigned short  bfReserved1; 
>         unsigned short  bfReserved2;
>         unsigned long   bfOffBits; 
> } BITMAPFILEHEADER; 
> typedef struct tagBITMAPINFOHEADER {    /* bmih */ 
>         unsigned long   biSize; 
>         unsigned long   biWidth; 
>         unsigned long   biHeight; 
>         unsigned short  biPlanes; 
>         unsigned short  biBitCount; 
>         unsigned long   biCompression; 
>         unsigned long   biSizeImage; 
>         unsigned long   biXPelsPerMeter; 
>         unsigned long   biYPelsPerMeter; 
>         unsigned long   biClrUsed; 
>         unsigned long   biClrImportant; 
> } BITMAPINFOHEADER; 
> typedef struct tagRGBBIT {     /* rgbq */ 
>         unsigned char    rgbBlue; 
>         unsigned char    rgbGreen; 
>         unsigned char    rgbRed; 
> } RGBBIT; 
> int main(void) 
> { 
>         printf("size of char: %d\n",sizeof(unsigned char)); 
>         printf("size of unsigned short: %d\n",sizeof(unsigned short)); 
>         printf("size of unsigned long: %d\n",sizeof(unsigned long)); 
>         printf("size of BITMAPFILEHEADER: %d\n",sizeof(BITMAPFILEHEADER)); 
>         printf("size of BITMAPINFOHEADER: %d\n",sizeof(BITMAPINFOHEADER)); 
>         printf("size of RGBBIT: %d\n",sizeof(RGBBIT)); 
>         return 0; 
> } 
> // ----------------- End of File ----------------------------- 
> ������: 
> size of char: 1 
> size of unsigned short: 2 
> size of unsigned long: 4 
> size of BITMAPFILEHEADER: 16 
> size of BITMAPINFOHEADER: 40 
> size of RGBBIT: 3 
> ��Ҫ������. ��~~~  
  ���÷�ɣ���һ�±�������Ƿ���԰Ѹ��Ż�ȥ����
  ��������Ķ�����Ҳ��Ҫ��Ҫ����ṹ�ˣ����԰�������ȥ�ɣ�//xixi

--
�� ��Դ: �й�ƴ�BBSվ [bbs.ustc.edu.cn]
Technical Details
Message-ID: <980819.z98is$PBBS@bbs.ustc.edu.cn>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB
X-Google-Thread: fc86e,242a777bd2572d0b
X-Google-Attributes: gidfc86e,public
From: Young_Yang@bbs.ustc.edu.cn (Sheep)
Subject: Re: DOS�µ�C++��UNIX�µ�C++�ı�������?
Date: 1998/08/19
Message-ID: <980819.z98is$PBBS@bbs.ustc.edu.cn>
X-Deja-AN: 383528447
Organization: �й�ƴ�BBSվ
Newsgroups: cn.bbs.comp.program