>
>
>
Are the types size_t and uintptr_t equi…

Andrey Karpov
Articles: 643

Are the types size_t and uintptr_t equivalent?

The question if these types are equivalent and which of them and when should be used is discussed very much. But in practice you may consider them equivalent and use them as you like.

Usually the type size_t is used to emphasize that we deal with an object containing some size, number of elements or iterations. The type uintptr_t is good for pointers.

If you do not know what type to prefer, use typedef to define your own type representing the thing you are working with.

References