N
Neo
Hi Folks,
I've a simple qestion related to dynamic memory allocation in C here is the
code:
#include <stdio.h>
int main()
{
char *p;
if( (p=(char*)malloc(0)) == NULL)
printf("NULL\n");
else
printf("Valid Pointer\n");
return 0;
}
Output : "Valid Pointer"
Why this code fragment returns a valid pointer to a memory block???
-Neo
I've a simple qestion related to dynamic memory allocation in C here is the
code:
#include <stdio.h>
int main()
{
char *p;
if( (p=(char*)malloc(0)) == NULL)
printf("NULL\n");
else
printf("Valid Pointer\n");
return 0;
}
Output : "Valid Pointer"
Why this code fragment returns a valid pointer to a memory block???
-Neo