Turn: VC word,dword,unsigned long,unsigned Short difference (turn)

Source: Internet
Author: User

typedef unsigned long DWORD;
typedef int BOOL;
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef float FLOAT;
typedef FLOAT *pfloat;
typedef BOOL near *pbool;
typedef BOOL FAR *lpbool;
typedef BYTE near *pbyte;
typedef BYTE FAR *lpbyte;
typedef int near *pint;
typedef int FAR *lpint;
typedef WORD near *pword;
typedef WORD FAR *lpword;
typedef long FAR *lplong;
typedef DWORD near *pdword;
typedef DWORD FAR *lpdword;
typedef void FAR *lpvoid;
typedef CONST void Far *lpcvoid;

typedef int INT;
typedef unsigned int UINT;
typedef unsigned int *puint;

The DWORD is actually unsigned long,uint is unsigned int.
A long in 16-bit Windows is 4 bytes, and int has only two bytes, and they are different;
32-bit Windows is 4 bytes, so the DWORD is the same as uint in Win32.

int is the number of digits of the standard computer 16-bit machine, 32-bit machine, and 64-bit machine respectively for 16,32,64
8-Bit Microcontroller word length 8bit, so int long is the software extension, for 32-bit win
int = 32
Long = 32
Short = 16

However, the number of bytes for long, short, and int is also related to the compiler

You can use sizeof in the VC to see its length, such as

sizeof (int) = 4, indicating 4 bytes, or 32 bits;

Because the standard does not specify the number of digits, many compilers and platforms are their own standards.
Anyhow sizeof (long) >= sizeof (int) >=sizeof (short)

Turn: VC word,dword,unsigned long,unsigned Short difference (turn)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.