Victor Bazarov
9/29/2008 8:45:00 PM
puzzlecracker wrote:
> How many cast can be used on void pointer
Infinitely many:
int main()
{
char const str[] = "abc";
void ptr = str;
while (true) // infinitely long
{
char const *pchar = static_cast<char const*>(prt);
}
}
The pointer when cast to another, does not degrade or affect the system.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask