Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Can your C compiler do this:

Name: Anonymous 2010-05-15 15:06


int main()
{
  int *p;
  p  = 0;
  *p = 0;
  return 0;
}


?

Name: Anonymous 2010-05-16 5:25

>>37
How else would you solve it if any unsigned int can be a valid pointer, and the internal representation of a pointer is an unsigned int? There's simply not enough bits to store the information to store that a pointer is invalid or null. You could reserve a special address to be null, but that has its drawbacks, and in some cases may even be unfeasible.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List