D
dam_fool_2003
hai,
Consider this following fragement
typedef struct node
{
...
...
...
struct node *next;
}NODE;
node *list;
NODE *link;
after some operation on the object list the program uses free(link) to
free mem.
I have two questions:
1) The object link alone get de-allocated or the along with the object
list? Or put it in this way , will it both get deleted?
2) What is the advantage of declaring the struct like this in a long
programs?
Consider this following fragement
typedef struct node
{
...
...
...
struct node *next;
}NODE;
node *list;
NODE *link;
after some operation on the object list the program uses free(link) to
free mem.
I have two questions:
1) The object link alone get de-allocated or the along with the object
list? Or put it in this way , will it both get deleted?
2) What is the advantage of declaring the struct like this in a long
programs?