C Language Learning--xxx_t data type uint8_t What kind of data type

Source: Internet
Author: User

What data type is uint8_t?

In the extended language of C, you will see a lot of data types that you don't know, such as uint8_t,in_addr_t. But these are not new data types.

What exactly does the _t mean.

It is a structural annotation that can be understood as a type/typedef abbreviation, indicating that it is defined by a TypeDef, not by other data types.
Uint8_t,uint16_t,uint32_t and so on, just use a typedef alias to type. typedef it will work well for the maintenance of your code. For example, there is no bool in C, some programmers use int, some programmers use short, it is more confusing, it is best to use a typedef to define, such as:
typedef char BOOL;

the *_t type for general shaping is :
1 bytes uint8_t
2 bytes uint16_t
4 bytes uint32_t
8 bytes uint64_t

header file Definition :

typedef signed Char int8_t;
typedef unsigned char uint8_t;

typedef int int16_t;
typedef unsigned int uint16_t;

typedef long int32_t;
typedef unsigned long uint32_t;

typedef long Long int64_t;
typedef unsigned long long uint64_t;

typedef int16_t intptr_t;
typedef uint16_t uintptr_t;

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.