Click here to Skip to main content
16,011,436 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: How to create and array of structs that have their own arrays? Pin
CPallini10-Sep-08 21:08
mveCPallini10-Sep-08 21:08 
AnswerRe: How to create and array of structs that have their own arrays? Pin
Electronic7510-Sep-08 21:18
Electronic7510-Sep-08 21:18 
QuestionRe: How to create and array of structs that have their own arrays? Pin
CPallini10-Sep-08 21:28
mveCPallini10-Sep-08 21:28 
AnswerRe: How to create and array of structs that have their own arrays? Pin
Electronic7510-Sep-08 21:46
Electronic7510-Sep-08 21:46 
GeneralRe: How to create and array of structs that have their own arrays? Pin
CPallini10-Sep-08 21:50
mveCPallini10-Sep-08 21:50 
AnswerRe: How to create and array of structs that have their own arrays? Pin
Cedric Moonen10-Sep-08 21:30
Cedric Moonen10-Sep-08 21:30 
GeneralRe: How to create and array of structs that have their own arrays? Pin
Electronic7510-Sep-08 21:49
Electronic7510-Sep-08 21:49 
GeneralRe: How to create and array of structs that have their own arrays? Pin
Cedric Moonen10-Sep-08 21:55
Cedric Moonen10-Sep-08 21:55 
Electronic75 wrote:
you mean I have to derive my own CArray class


No, I mean you have to provide a =operator and a copy constructor for your structure. Inside those, instead of simply assigning the arrays, like this:

mystruct::myStruct(const mystruct& copy)
{
  array1 = copy.array1;
}


you will need to copy the content of the array by iterating over it.


Electronic75 wrote:
isn't another way I mean another array class that can do the trick!


std::string or std::list maybe ? But you have to be carefull of what is inside those arrays. If you store pointers, you will have a copy of the original pointer pointing at the same memory location, so you should only delete one of them (so, it's a bit dangerous).

Cédric Moonen
Software developer

Charting control [v1.5]
OpenGL game tutorial in C++

GeneralRe: How to create and array of structs that have their own arrays? Pin
Electronic7511-Sep-08 0:04
Electronic7511-Sep-08 0:04 
QuestionHow to send data between PC usb port to a WinCE usb port? Pin
Priya_Sundar10-Sep-08 20:26
Priya_Sundar10-Sep-08 20:26 
AnswerRe: How to send data between PC usb port to a WinCE usb port? Pin
Cedric Moonen10-Sep-08 20:38
Cedric Moonen10-Sep-08 20:38 
GeneralRe: How to send data between PC usb port to a WinCE usb port? Pin
Priya_Sundar11-Sep-08 0:27
Priya_Sundar11-Sep-08 0:27 
GeneralRe: How to send data between PC usb port to a WinCE usb port? Pin
Cedric Moonen11-Sep-08 0:48
Cedric Moonen11-Sep-08 0:48 
Questionhow to create .MSG files and .EML files using vc++ Pin
ravimalikmca10-Sep-08 20:02
ravimalikmca10-Sep-08 20:02 
Question#import type library Pin
George_George10-Sep-08 19:42
George_George10-Sep-08 19:42 
AnswerRe: #import type library Pin
SandipG 10-Sep-08 20:47
SandipG 10-Sep-08 20:47 
GeneralRe: #import type library Pin
George_George10-Sep-08 20:52
George_George10-Sep-08 20:52 
GeneralRe: #import type library Pin
SandipG 10-Sep-08 21:47
SandipG 10-Sep-08 21:47 
GeneralRe: #import type library Pin
George_George10-Sep-08 21:54
George_George10-Sep-08 21:54 
GeneralRe: #import type library [modified] Pin
SandipG 10-Sep-08 22:04
SandipG 10-Sep-08 22:04 
GeneralRe: #import type library Pin
George_George10-Sep-08 23:33
George_George10-Sep-08 23:33 
Questionhow to retrieve all details on installed products in system Pin
yadhvi10-Sep-08 19:31
yadhvi10-Sep-08 19:31 
AnswerRe: how to retrieve all details on installed products in system Pin
Hamid_RT10-Sep-08 19:43
Hamid_RT10-Sep-08 19:43 
GeneralRe: how to retrieve all details on installed products in system Pin
Rane10-Sep-08 20:26
Rane10-Sep-08 20:26 
Questionlinking error in C code! Pin
ishwarverma10-Sep-08 19:26
ishwarverma10-Sep-08 19:26 

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.