Deep copy problems



 DEVELOP > c-Plus-Plus > Deep copy problems

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
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?
.


  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER