C
Carl
I am reading a book on C after my introductory C course, and I noticed
that in my book it claimed that the NULL macro can be values other than
(void *)0. The book claims that NULL can be an address that cannot be
accessed, so it is possible for the hardware to catch errors. If that
is the case, would such as the following be wrong in certain environments:
int *a;
a = malloc( sizeof(int) );
if(!a)
{
printf("Unable to allocate memory!\n");
exit(1);
}
that in my book it claimed that the NULL macro can be values other than
(void *)0. The book claims that NULL can be an address that cannot be
accessed, so it is possible for the hardware to catch errors. If that
is the case, would such as the following be wrong in certain environments:
int *a;
a = malloc( sizeof(int) );
if(!a)
{
printf("Unable to allocate memory!\n");
exit(1);
}