size_t

Jan 17, 2012 at 1:51pm
I want to know about size_t. What is it?? a daatype or anything else?? Please post if anyone has an idea regarding the same. I am new to this forum and am interested in interraction on C++.

Thanks in advance
Jan 17, 2012 at 2:06pm
It's an alias for int or long, I'm not sure. Created using typedef.
Jan 17, 2012 at 2:59pm
size_t is used by standard library to represent a size, for exemple a size to allocate or an offset in a file. I think it is an alias of unsigned int but i's probably compiler dependanrt.
Jan 17, 2012 at 3:27pm
> size_t is used by standard library to represent a size,

An alias for some unsigned basic integral type that is large enough to represent the size (number of bytes occupied in memory) of any object. Usually either an unsigned int or an unsigned long; though an unsigned long long is allowed.

> for exemple a size to allocate or an offset in a file

That is a std::streamoff - an alias for some signed basic integral type that is large enough to represent the maximum possible size of a file.
Jan 19, 2012 at 12:24pm
So, what exactly is size_t, an alias for unsigned int or unsigned long or unsigned long long..??
Or is it compiler dependent..??
Jan 19, 2012 at 12:49pm
Apparently compiler (standard library implementation) dependant. Why does it matter though?
Jan 19, 2012 at 1:23pm
it is an alias for unsigned created using typedef facility...if u want to see it then goto "stdio.h" file and open and see it ur self
Jan 20, 2012 at 12:35pm
Thank u all..
Topic archived. No new replies allowed.