How to use intptr_t
This article introduces the knowledge of "how to use intptr_t". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Definition of intptr_t: / * Types for `void * 'pointers. * / # if _ _ WORDSIZE = = 6 years ifndef _ _ intptr_t_definedtypedef long int intptr_t;# define _ _ intptr_t_defined# endiftypedef unsigned long int uintptr_t;#else# ifndef _ _ intptr_t_definedtypedef int intptr_t;# define _ _ intptr_t_defined# endiftypedef unsigned int uintptr_t;#endif
You can see that the pointer is used to hold the address of the variable or constant, which is determined by the number of bits of the processor. The handle in the Windows program is an address. Intptr_t is different on different platforms, always has the same number of bits as the address, and is used to store addresses.
Intptr_t is used to ensure the versatility of the platform, and the length of compilation varies from platform to platform.
That's all for "how to use intptr_t". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!