Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to understand size_t size in function prototype
How to understand size_t size in function prototype
Size_t is actually a type, similar to unsigned int.

When you say size_t size, you can understand it as unsigned int size;; You can use it as an unsigned int.

Size_t is generally used to represent the length of a group, so it must be a positive number. It is large enough to store as large an array as possible.

For example, I want to assign a subscript to each element of array a[array_size]:

Const size_t array _ size =10; int a[array _ size- 1]; for(size _ t I = 0; I & ltsize _ t;; ++ I)a[I]= I;

After all, size_t can be used as an unsigned int.