Viva64 Send comments on this topic.
Memsize types

Glossary Item Box

As "memsize" types we consider the types which are able to store a pointer. To the "memsize" types are ascribed a certain pointer and whole types, the size of which agrees with the size of the pointer

Examples:

Memsize types
The size of a type for:
Comment
32-bit platform
64-bit platform
all pointers
32
64
 
size_t
32
64
Result of sizeof operator.
You can use a variable of type size_t to define sizes of strings and memory blocks.
ptrdiff_t
32
64
Special type for pointer arithmetic, which is a typedef of a platform-specific signed integral type. You can use a variable of type ptrdiff_t to store the result of subtracting and adding pointers.
For example:
extern int *ptr_1, *ptr_2;
ptrdiff_t diff = ptr_2 - ptr_1;
intptr_t
32
64
 
uintptr_t
32
64
 
SIZE_T
32
64
 
SSIZE_T
32
64
 
INT_PTR
32
64
 
UINT_PTR
32
64
 
LONG_PTR
32
64
 
ULONG_PTR
32
64
 
DWORD_PTR
32
64
 

See also:

Standard Types (MSDN); Windows Data Types (MSDN)