Copying an object



Hi,
I have C structs containing data and pointers to other objects and data.
It is like OOP in C. I need to make a copy of an object, but found it is
really tedious in C. The data in the struct can be copied, but you need
to recursively follow pointers, do a malloc, then copy the data that was
pointed at, into the new malloced area.

Is there an easy way to do it? Can g_object do it? C++?




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]