tags:

views:

103

answers:

1

I have old code that uses size_t which IIRC comes from cstring.h.

On OS X, I either dont know how to find/use this or it is not available.

What would I replace it with?

+2  A: 

The canonical place to find std::size_t is in <cstddef>.

I'm fairly sure that this worked for me the last time I was working on OS X.

Edit: Just found an OS X system to test on, not sure the exact system version but the Apple version of gcc 4.0.1 and both size_t and std::size_t are valid names of types after #include <cstddef>.

Charles Bailey
@Charles, perfect, that works for me. Do you have any advice for porting from CS to XCode and issues, work-arounds, etc?
ML
CS code? To be honest, I'm not a great XCode user so I'm not the best person for advice. Most of my work on OS X is just ensuring that command line C++ programs port across. If you stick to standard C++ then most things seem to work, but then I'm not an OS X expert.
Charles Bailey
@Charles - Doh, CodeWarrior (CW) not CS!
ML