I am not a veteran in C or C++. I don't know the howtime_t
is defined and designed.
Several posts like:
- What is ultimately a time_t typedef to?
- What is size_t in C?
- Difference between size_t and std::size_t
But these posts only state what is time_t
or size_t
. It didn't state clearly how and where is time_t or size_t defined and declared.
I am using WIN8 VS2012 Express C++. I searched the library and found that size_t
is defined in crtdefs.h
instead of cstddef
.
- Why need types like
size_t
,time_t
? We can letsizeof
just returnunsigned int
. - Why C++ library does not define
size_t
? - Can I say size_t is NOT a C/C++ built-in type?
- I never need to include the corresponding header file in my program to use
size_t
ortime_t
(maybe they are defined instd
namespace).
I searched again in the library, and found size_t
is defined as typedef _W64 unsigned int size_t
, and _W64
is defined as __w64
. Up here, I cannot search more on where is __w64
is defined or declared.
- What is
__w64
type? It is not stated in the C++11/C99 standard.
Similarly when I searched the time_t
, I found __int6
. But does not know where __int64
comes from.