How do i copy entire objects using a copy constructor?
Here is my code right now.
Equal operator:
disk disk::operator=(const disk ©) {
disk scopy(copy);
}
Copy constructor:
disk::disk(const disk &from) {
strcpy(mmode, from.mmode);
size_max = from.size_max;
num = from.num;
s = new segment[size_max];
//strcpy(s, from.s);
}
The copy constructor so far copies all the values of the variables, but how do i copy what is in the object? i tried using strcpy but it doesn't seem to work.
Thanks in advance!

New Topic/Question
Reply




MultiQuote







|