Guest_imported
New member
- Jan 1, 1970
- 0
i have a doubts,
in c we can assign one structure variable to another
example
typedef struct
{
int i;
}test;
test a;
a.i=1;
test b=a;
this is a case of simple bit copying
now what happens when the elements of a structure are pointers
or that it allocates memory. Is it that same piece of memory would be allocated twice or released twice?
in c we can assign one structure variable to another
example
typedef struct
{
int i;
}test;
test a;
a.i=1;
test b=a;
this is a case of simple bit copying
now what happens when the elements of a structure are pointers
or that it allocates memory. Is it that same piece of memory would be allocated twice or released twice?