In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces how to understand int8_t and int64_t and size_t and ssize_t. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.
Uint8_t and so on.
So what exactly does t mean? The specific official answer has not been found, but I think one is relatively close. It is a structural annotation, which can be understood as an abbreviation for type/typedef, indicating that it is defined through typedef rather than other data types. Since none of them are new data types, they are just aliases for types using typedef, so why do you need to define them? Because different platforms have different word lengths across platforms, using precompilation and typedef allows you to maintain your code most effectively.
They are defined in the stdint.h header file, and the following code is copied from / usr/include/stdint.h
/ * There is some amount of overlap with as known by inet code * / # ifndef _ _ int8_t_defined# define _ _ int8_t_definedtypedef signed char int8_t;typedef short int int16_t;typedef int int32_t;# if _ WORDSIZE = = 64typedef long int int64_t;# else__extension__typedef long long int int64_t;# endif#endif/* Unsigned. * / typedef unsigned char uint8_t;typedef unsigned short int uint16_t;#ifndef _ _ uint32_t_definedtypedef unsigned int uint32_t;# define _ _ uint32_t_defined#endif#if _ WORDSIZE = = 64typedef unsigned long int uint64_t;#else__extension__typedef unsigned long long int uint64_t;#endif
After reading the above code, you will have a clear understanding of uint8_t and so on.
Size_t/ssize_t
With regard to size_t/ssize_t, anxious students can look at the conclusion first.
Size_t unsigned integer 32bit system is equivalent to unsigned int 64bit system is equivalent to unsigned long int.
Ssize_t signed integer 32bit system is equivalent to int 64bit system is equivalent to long int.
In the 32bit system, long int is 32bit, and in the 64bit system, long int is 64bit.
You can look at / usr/include/sys/types.h layer by layer, and eventually you'll find the definitions of ssize_t and size_t.
How to judge the number of system digits
Getconf WORD_BIT
Getconf LONG_BIT
Or use uname-a
On how to understand int8_t and int64_t and size_t as well as ssize_t to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.