I have a struct which contains strings and pointer within. Is there any library functions available to do a deep copy of the struct into another. I don’t want to do a field by field copy since the struct I’m having is quite large.
Does glib have any function that does the trick?
You can use memcpy or memmove to copy the entire contents of the struct itself. However, as C has no introspection, copying pointed-to objects can’t be done by a general purpose function.
Edited to add: As several commenters note, you can just assign structures to other structures in the C dialects in use for the last couple of decades, memcpy is not needed any longer.