| Topic: |
DEVELOP > c-Plus-Plus |
| User: |
"Ace Alexander" |
| Date: |
08 Jul 2003 12:06:35 AM |
| Object: |
Deep copy problems |
I searched the internet and this news group and am still having
problems grasping this concept. I have:
struct file
{
bool open;
vector<file*>my_files;
};
I initialize a file:
file main_file;
I also set all the pointers of my_files, and the pointers of those
my_files in main_file.
I then create an array which I want to use a deep copy of main_file.
Ex: file_arr[0]=main_file;
What is throwing me off is the file* vector my_files. How do I do a
deep copy of the struct file so that it also deep copies the file*
array?
Thank you,
Ace Alexander
.
|
|
| User: "Ron Natalie" |
|
| Title: Re: Deep copy problems |
08 Jul 2003 09:20:52 AM |
|
|
"Ace Alexander" <ace.alexander@webs101.com> wrote in message news:11be7001.0307072106.2c89314c@posting.google.com...
What is throwing me off is the file* vector my_files. How do I do a
deep copy of the struct file so that it also deep copies the file*
array?
Depends on how you deep copy file*.
It's not clear form the little you've presented here what you are doing.
Is there some reason why you are using file*'s in the vector rather than just
file?
.
|
|
|
|

|
Related Articles |
|
|