Make Copy of structures with huge no. of pointer members
Hi,
I have a structure, that reads someting like:
Code:
struct _B {
int info;
struct _C *p4;
}
typedef struct _A{
int a,b,c;
int *p1;
char *p2;
struct _B *p3;
/* Many more pointers */
}A;
Have to write a copy function,
A *make_copy(A *src);
i.e. make_copy makes a copy of 'src' and returns. Note that it should properly copy pointers also (i.e. make copy of pointer members also).
Apart from copying member by member, is there any other way to do same?