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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The canonical place to find
std::size_tis 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_tandstd::size_tare valid names of types after#include <cstddef>.