Does the C99/C++11 standard guarantee that sizeof(size_t) == sizeof(void*)
is always true?
size_t f(void* p)
{
return (size_t)(p); // Is it safe?
}
void* f(size_t n)
{
return (void*)(n); // Is it safe?
}
See Question&Answers more detail:os