Taggi
January 18th, 2003, 12:10 PM
Hello.
I have a problem with arrays... well surprising isn't it? *g*
I have declared a struct with 5 member variables.
Now I created an Array of this sruct with 5 Objects of this struct.
Later I want in my programm to copy this 5 objects into another array, which is an array of this struct too.
Now my problem: how?
Sure you can type for each object and Member:
SecondArray[i].FirstMemberVar = FirstArray[i].FirstMemberVar;
SecondArray[i].SecondMemberVar = FirstArray[i].SecondMemberVar;
...
but is there another way without defining a copycontructor? Something linke CopyMemory or strcpy with chars?
Or something like this:
two arrays with 5 objects each, have to be copied in one array with 10 objects. How do I do this?
Taggi
I have a problem with arrays... well surprising isn't it? *g*
I have declared a struct with 5 member variables.
Now I created an Array of this sruct with 5 Objects of this struct.
Later I want in my programm to copy this 5 objects into another array, which is an array of this struct too.
Now my problem: how?
Sure you can type for each object and Member:
SecondArray[i].FirstMemberVar = FirstArray[i].FirstMemberVar;
SecondArray[i].SecondMemberVar = FirstArray[i].SecondMemberVar;
...
but is there another way without defining a copycontructor? Something linke CopyMemory or strcpy with chars?
Or something like this:
two arrays with 5 objects each, have to be copied in one array with 10 objects. How do I do this?
Taggi