Click here to Skip to main content
16,004,686 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionData file Pin
Calin Negru26-Aug-24 2:36
Calin Negru26-Aug-24 2:36 
AnswerRe: Data file Pin
Maximilien26-Aug-24 3:29
Maximilien26-Aug-24 3:29 
AnswerRe: Data file Pin
k505426-Aug-24 3:30
mvek505426-Aug-24 3:30 
AnswerRe: Data file Pin
Dave Kreskowiak26-Aug-24 3:32
mveDave Kreskowiak26-Aug-24 3:32 
GeneralRe: Data file Pin
Calin Negru26-Aug-24 4:20
Calin Negru26-Aug-24 4:20 
QuestionInheritance and arrays thread follow up Pin
Calin Negru23-Aug-24 7:05
Calin Negru23-Aug-24 7:05 
AnswerRe: Inheritance and arrays follow up Pin
Mircea Neacsu23-Aug-24 7:38
Mircea Neacsu23-Aug-24 7:38 
AnswerRe: Inheritance and arrays follow up Pin
k505423-Aug-24 7:45
mvek505423-Aug-24 7:45 
unit* LUnits = new units[2] creates an array of 2 unit, not an array of 2 pointers to unit.
You probably want a double dereference:
C++
unit** LUnits = new units*[2];  // create an array of pointers to unit
soldier* S = new soldier;
unit[0] = S; // nb we don't need to down cast from soldier to unit
It feels like there should be a better way to do that.
"A little song, a little dance, a little seltzer down your pants"
Chuckles the clown


modified 23-Aug-24 13:54pm.

GeneralRe: Inheritance and arrays follow up Pin
Calin Negru23-Aug-24 8:24
Calin Negru23-Aug-24 8:24 
QuestionAdding object to class - which option makes more sense ? Pin
jana_hus18-Aug-24 4:45
jana_hus18-Aug-24 4:45 
AnswerRe: Adding object to class - which option makes more sense ? Pin
k505418-Aug-24 6:10
mvek505418-Aug-24 6:10 
GeneralRe: Adding object to class - which option makes more sense ? Pin
jana_hus18-Aug-24 6:26
jana_hus18-Aug-24 6:26 
GeneralRe: Adding object to class - which option makes more sense ? Pin
k505418-Aug-24 8:14
mvek505418-Aug-24 8:14 
AnswerRe: Adding object to class - which option makes more sense ? Pin
Richard MacCutchan18-Aug-24 6:22
mveRichard MacCutchan18-Aug-24 6:22 
QuestionSystem.* not defined or imported Pin
Pieter Claassens15-Aug-24 3:58
Pieter Claassens15-Aug-24 3:58 
AnswerRe: System.* not defined or imported Pin
Greg Utas15-Aug-24 4:13
professionalGreg Utas15-Aug-24 4:13 
AnswerRe: System.* not defined or imported Pin
k505415-Aug-24 4:15
mvek505415-Aug-24 4:15 
AnswerRe: System.* not defined or imported Pin
Pieter Claassens15-Aug-24 4:17
Pieter Claassens15-Aug-24 4:17 
QuestionIs it possible to find a shortlist of Bios registers and methods to use them? C/ASM programming Pin
Alex D Aug202414-Aug-24 13:04
Alex D Aug202414-Aug-24 13:04 
AnswerRe: Is it possible to find a shortlist of Bios registers and methods to use them? C/ASM programming Pin
jschell14-Aug-24 13:53
jschell14-Aug-24 13:53 
AnswerRe: Is it possible to find a shortlist of Bios registers and methods to use them? C/ASM programming Pin
Dave Kreskowiak14-Aug-24 16:29
mveDave Kreskowiak14-Aug-24 16:29 
QuestionInheritance and STL containers Pin
Calin Negru12-Aug-24 3:55
Calin Negru12-Aug-24 3:55 
AnswerRe: Inheritance and STL containers Pin
Richard MacCutchan12-Aug-24 4:52
mveRichard MacCutchan12-Aug-24 4:52 
GeneralRe: Inheritance and STL containers Pin
Calin Negru12-Aug-24 5:42
Calin Negru12-Aug-24 5:42 
AnswerRe: Inheritance and STL containers Pin
Mircea Neacsu12-Aug-24 6:38
Mircea Neacsu12-Aug-24 6:38 

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.