Where is size_t usually defined?  I am using C++, and I cannot find a
typedef something size_t;

I do find something like this in a file
 #define _SIZT      size_t

But I do not know what  _SIZT is.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

There are prior question such as yours. Presumably you are programming in a windows env where according to those _SIZT IS A vendor macro defined to size_t.

Can not post the link here, but searching for _SIZT c++ will list a similar question to your from 2006.
'size_t' isn'd '#define'd anywhere (in terms of a preprocessor macro expansion), it is ''typedef'd, i.e. defined as a type by code that your compiler processes - while quite 'similar' to a '#define', this is not even close to be the same thing. It introduces a - well, not so new - type that basically resembles an unsigned integer of the platform you are on (32 or 64 bits).
size_t is the unsigned integer type of the result of the sizeof operator (ISO C99 Section 7.17.)

The actual type of size_t is platform-dependent; a common mistake is to assume size_t is the same as unsigned int, which can lead to programming errors, particularly as 64-bit architectures become more prevalent.
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

evilrixSenior Software Engineer (Avast)Commented:
The actual definition of size_t can normally be found in cstdlib; however, it can also be defined in any of the following :

#define _SIZT      size_t
#define defines macros from left to right. so the statement you found "makes" _SIZT to be a synonym for size_t and not the other way round.

_SIZT is a macro defined in <xmemory> what is a header file for standard lib STL of the visual c++ compiler. i found it in vs2008 (vc9) but not in vs2012 (vc11) what it is a strong evident that it was used for compability reasons to older versions of visual c++ compiler.

the size_t in current versions of visual c++ compiler is indeed a typedef (as stated by jkr) in the VC include file vadefs.h

typedef _W64 unsigned int   size_t;

Open in new window

for a WIN32 project where _W64 is a macro that is defined as

#define _W64 __w64

where __w64 is a compiler macro that is used for 32-bit projects (x86) only  according the following MS statement:

Any typedef that has __w64 on it must be 32 bits on x86 and 64 bits on ARM and x64.
(it probably is some kind of MS running gag to using the sequence '64' only for 32-bit purposes),

evilrixSenior Software Engineer (Avast)Commented:
>> it probably is some kind of MS running gag to using the sequence '64' only for 32-bit purpose
In much the same way as they insist on using WIN32 even for 64 bit programs :)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.