I am 100% puzzled about pointers....
consider the following programme...
#include <stdio.h>
#include <mem.h>
int main(void)
{
char *name;
name=(char *)malloc(20);
name="Puzzled Man";
printf("The name is %s",name);
free(name); //memory is free
printf("the variable is %s",name);
/* if there is no memory allocated for the pointer then where the value is coming from???*/
return 0;
}
Pls help me........