Click here to Skip to main content
16,010,334 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: a CArray of structures containing other CArrays? Pin
b_girl27-Jan-04 6:49
b_girl27-Jan-04 6:49 
GeneralRe: a CArray of structures containing other CArrays? Pin
b_girl27-Jan-04 7:31
b_girl27-Jan-04 7:31 
GeneralRe: a CArray of structures containing other CArrays? Pin
Antti Keskinen27-Jan-04 7:57
Antti Keskinen27-Jan-04 7:57 
GeneralRe: a CArray of structures containing other CArrays? Pin
b_girl27-Jan-04 8:04
b_girl27-Jan-04 8:04 
GeneralRe: a CArray of structures containing other CArrays? Pin
Antti Keskinen27-Jan-04 9:35
Antti Keskinen27-Jan-04 9:35 
GeneralRe: a CArray of structures containing other CArrays? Pin
Diddy27-Jan-04 10:47
Diddy27-Jan-04 10:47 
GeneralRe: a CArray of structures containing other CArrays? Pin
b_girl28-Jan-04 5:05
b_girl28-Jan-04 5:05 
GeneralRe: a CArray of structures containing other CArrays? Pin
Antti Keskinen28-Jan-04 6:52
Antti Keskinen28-Jan-04 6:52 
You define a copy contstructor for the structure itself, not the array inside it.

If your application required a copy constructor for the CArray, you would require to derive from CArray and implement a new class yourself: in this way, you would be able to define it's copy constructor. But that is not what you need.

Here is an example on implementing a copy constructor for a struct:
struct MyStruct
{
public:
   MyStruct(const MyStruct& oldStruct);<DIV>

   int iInteger;
   double dDouble;<DIV>

   // Other data members possibly
};<DIV>

MyStruct::MyStruct( const MyStruct& oldStruct )
{
    // Copy constructor implementation
}
The struct works pretty much in a similar way as a class does, but it has it's limitations, like member functions and so on. The access-level specification at the start of the struct is just a precaution: structures are public by default.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: a CArray of structures containing other CArrays? Pin
Diddy28-Jan-04 10:56
Diddy28-Jan-04 10:56 
GeneralRe: a CArray of structures containing other CArrays? Pin
b_girl29-Jan-04 3:41
b_girl29-Jan-04 3:41 
GeneralRe: a CArray of structures containing other CArrays? Pin
b_girl29-Jan-04 4:56
b_girl29-Jan-04 4:56 
AnswerRe: a CArray of structures containing other CArrays? Pin
toxcct27-Jan-04 8:43
toxcct27-Jan-04 8:43 
GeneralRe: a CArray of structures containing other CArrays? Pin
b_girl28-Jan-04 3:33
b_girl28-Jan-04 3:33 
AnswerRe: a CArray of structures containing other CArrays? Pin
Christian Graus27-Jan-04 9:40
protectorChristian Graus27-Jan-04 9:40 
GeneralError Program Pin
Member 64882827-Jan-04 6:14
Member 64882827-Jan-04 6:14 
GeneralRe: Error Program Pin
Steve S27-Jan-04 6:54
Steve S27-Jan-04 6:54 
GeneralRe: Error Program Pin
John R. Shaw27-Jan-04 8:53
John R. Shaw27-Jan-04 8:53 
QuestionHow to associate image with CStatic?? Pin
Dominik Reichl27-Jan-04 6:05
Dominik Reichl27-Jan-04 6:05 
Generalsmall design question C++/MFC Pin
Maximilien27-Jan-04 5:23
Maximilien27-Jan-04 5:23 
GeneralRe: small design question C++/MFC Pin
valikac27-Jan-04 6:14
valikac27-Jan-04 6:14 
GeneralExpression analysis Pin
Goh Hui Beng27-Jan-04 5:10
Goh Hui Beng27-Jan-04 5:10 
GeneralChoose language at runtime Pin
MyttO27-Jan-04 5:02
MyttO27-Jan-04 5:02 
GeneralRe: Choose language at runtime Pin
Mukkie27-Jan-04 7:42
Mukkie27-Jan-04 7:42 
GeneralRe: Choose language at runtime Pin
MyttO27-Jan-04 21:59
MyttO27-Jan-04 21:59 
GeneralExplicit loading of extension DLL Pin
spingkoy27-Jan-04 4:21
spingkoy27-Jan-04 4:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.