When I run this code:
#include
typedef struct _Food
{
char name [128];
} Food;
int
main (int argc, char **argv)
{
Food *f
There is nothing like free food :) When you "free" something, it means that the same space is again ready to be used by something else. It does NOT mean filling it up by garbage. Secondly, the pointer value has not changed -- if you are seriously coding you should set a pointer to NULL once you have freed it so that potential junk accesses like this do not happen.