What is the typdef size_t actual code definition

2194 views c
0

I am starting to learn c now ,after looking all over I cannot find the actual code definition for size_t in the header files.

I am trying to understand how this is defined because I believe it is system dependent.

Can someone direct/show the actual definition code.

answered question

sizeof is an operator, not a function.

Where did you look? The first header to check is stddef.h

checked it cannot see can you copy

"I am trying to understand how this is defined because I believe it is system dependent." Indeed. "Can someone direct/show the actual definition code." No, because it is system dependent...

But it is defined somewhere in the header or am I wrong?

@YinonDotan You need to be able to find the stddef.h file and look inside it. If you can not find the file or the definition of size_T, your compiler installation is broken.

If you really took a peek inside the header, you probably noticed it includes other system specific headers. So your search continues...

size_t is a type definition of unsigned.

1 Answer

5

size_t is an unsigned integer data type which is defined in various header files like: , , , , < time .h>, Copy Code. It's a type which is used to represent sizes of objects in bytes, hence it can be returned by the sizeof operator.

posted this

Have an answer?

JD

Please login first before posting an answer.