[ale] Copy a Structure - A C Question

Terry Lee Tucker terry at esc1.com
Fri Jun 14 07:05:07 EDT 2002


Good Morning ALE'rs:

This is a question for the C programmers out there. I have a situation 
where I need to copy a rather large data structure to another memory 
location. Is there a C function that I can use to do this rather than 
going through the arduous task of allocating memory and coping each 
element manually? In addition, since this project is still in 
development, the makeup of the structure may change and I don't want to 
worry about having to keep my manual routine updated. The structure 
contains a combination of character arrays, integer values and pointers 
to other structures. Since this is a structure, is all the allocated 
memory for the structure in one contiguous chunk? If so, could I then 
use something like memcpy to do the job?

-- 
Sparta, NC 28675 USA
336.372.6812
http://www.esc1.com
The Gates of hell shall NOT prevail...



---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list