What's in C size_t

You are using an outdated browser. This may not be able to display this or other websites correctly.
You should update your browser or use an alternative browser.
Hello guys, can someone tell me what is the difference between size_t and int .......... as far as I understand, size_t and int are the same, if so, what do I need size_t for

Many Thanks
G from Göttingen!
AW: size_t in C ++

Hi hamdy,

-google it if you don't get any help here ...
... as far as I still know size_t is an "unsigned" size
and int a "signed"

Greetings Uwe
AW: size_t in C ++

Hi! :)

size_t is an integer, unsigned data type that is almost always synonymous with the type unsigned long int or with unsigned int. It is used to specify the size of a memory area. Depending on the computer, a 2 or 4-byte value may be necessary for this, which is why the size_t type was created, which can now be used on every implementation for working with memory sizes. size_t is in stddef.h, but mostly also agreed in other header files.

So, I think the only difference is that the data type "size_t" is in the other header file, otherwise you can use it in almost the same way as "unsigned int"!

Iron monkey