Click here to Skip to main content
16,003,902 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: SOLVED EDIT / BUMP Qt QtCreator "connect" - need help with lambda C++ syntax Pin
Richard MacCutchan10-Aug-24 21:19
mveRichard MacCutchan10-Aug-24 21:19 
QuestionDELETED Please help me (with) improving my coding skill(s) - how to access iterated object. Pin
jana_hus8-Aug-24 6:41
jana_hus8-Aug-24 6:41 
SuggestionRe: Please help me (with) improving my coding skill(s) - how to access iterated object. Pin
David Crow8-Aug-24 7:37
David Crow8-Aug-24 7:37 
QuestionInheritance and arrays Pin
Calin Negru8-Aug-24 0:49
Calin Negru8-Aug-24 0:49 
AnswerRe: Inheritance and arrays Pin
Mircea Neacsu8-Aug-24 0:58
Mircea Neacsu8-Aug-24 0:58 
GeneralRe: Inheritance and arrays Pin
Calin Negru8-Aug-24 4:28
Calin Negru8-Aug-24 4:28 
AnswerRe: Inheritance and arrays Pin
Richard MacCutchan8-Aug-24 1:01
mveRichard MacCutchan8-Aug-24 1:01 
GeneralRe: Inheritance and arrays Pin
Mircea Neacsu8-Aug-24 2:31
Mircea Neacsu8-Aug-24 2:31 
Let me respectfully comment:
soldier * S = new soldier();
//LUnits[0] = dynamic_cast<unit*>(S);
//no need for 'dynamic_cast' a pointer to derived can always be converted to pointer to base so:
LUnit[0] = S;

sailor* AB = new sailor();
//LUnits[1] = dynamic_cast<unit*>(AB); //same argument
LUnit[1] = AB;

// and then sometime later

sailor* tar = dynamic_cast<sailor*>(LUnits[1]);

// but if you do 
soldier* squaddie = dynamic_cast<soldier*>(LUnits[1]);
// you have a pointer that is incorrect
// you have a NULL pointer. This is the standard conforming behaviour.

For details see: dynamic_cast conversion - cppreference.com[^]
Mircea

GeneralRe: Inheritance and arrays Pin
Richard MacCutchan8-Aug-24 2:50
mveRichard MacCutchan8-Aug-24 2:50 
GeneralRe: Inheritance and arrays Pin
Calin Negru8-Aug-24 4:30
Calin Negru8-Aug-24 4:30 
GeneralRe: Inheritance and arrays Pin
Richard MacCutchan8-Aug-24 4:34
mveRichard MacCutchan8-Aug-24 4:34 
QuestionNotes in MFC/Win32 App Pin
john56326-Aug-24 4:34
john56326-Aug-24 4:34 
AnswerRe: Notes in MFC/Win32 App Pin
Richard MacCutchan6-Aug-24 4:36
mveRichard MacCutchan6-Aug-24 4:36 
AnswerRe: Notes in MFC/Win32 App Pin
Maximilien6-Aug-24 7:38
Maximilien6-Aug-24 7:38 
QuestionEnumerations Pin
Calin Negru5-Aug-24 23:32
Calin Negru5-Aug-24 23:32 
AnswerRe: Enumerations Pin
Victor Nijegorodov5-Aug-24 23:38
Victor Nijegorodov5-Aug-24 23:38 
GeneralRe: Enumerations Pin
Calin Negru6-Aug-24 1:21
Calin Negru6-Aug-24 1:21 
QuestionVoluntarily DELETED - wrong forum Pin
jana_hus4-Aug-24 17:24
jana_hus4-Aug-24 17:24 
AnswerRe: Qt mdiArea - how to "connect" between subwindow (object) ? Pin
k50544-Aug-24 6:31
mvek50544-Aug-24 6:31 
GeneralRe: Qt mdiArea - how to "connect" between subwindow (object) ? Pin
Dave Kreskowiak4-Aug-24 11:35
mveDave Kreskowiak4-Aug-24 11:35 
AnswerRe: Qt mdiArea - how to "connect" between subwindow (object) ? Pin
Dave Kreskowiak4-Aug-24 6:33
mveDave Kreskowiak4-Aug-24 6:33 
GeneralRe: Qt mdiArea - how to "connect" between subwindow (object) ? Pin
Richard MacCutchan5-Aug-24 0:24
mveRichard MacCutchan5-Aug-24 0:24 
Questiondialog update Pin
wa!72-Aug-24 18:28
wa!72-Aug-24 18:28 
AnswerRe: dialog color Pin
OriginalGriff2-Aug-24 18:32
mveOriginalGriff2-Aug-24 18:32 
QuestionMFC CIPAddressCtrl - How to detect blank field (octet)? Pin
Member 163267082-Aug-24 11:35
Member 163267082-Aug-24 11:35 

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.