Click here to Skip to main content
15,901,666 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder12-Jul-09 22:37
cofounderChris Maunder12-Jul-09 22:37 
PinnedHOW TO ASK A QUESTION PinPopular
Chris Maunder12-Feb-09 17:19
cofounderChris Maunder12-Feb-09 17:19 
QuestionOkay, real C++ question - who makes use of the auto keyword? Pin
charlieg21hrs 31mins ago
charlieg21hrs 31mins ago 
AnswerRe: Okay, real C++ question - who makes use of the auto keyword? Pin
Mircea Neacsu20hrs 32mins ago
Mircea Neacsu20hrs 32mins ago 
GeneralRe: Okay, real C++ question - who makes use of the auto keyword? Pin
Richard Andrew x6419hrs 49mins ago
professionalRichard Andrew x6419hrs 49mins ago 
AnswerRe: Okay, real C++ question - who makes use of the auto keyword? Pin
Dave Kreskowiak18hrs 6mins ago
mveDave Kreskowiak18hrs 6mins ago 
AnswerRe: Okay, real C++ question - who makes use of the auto keyword? Pin
CPallini2hrs 33mins ago
mveCPallini2hrs 33mins ago 
Questionmfc, vs2022 compatible? Pin
charlieg17-May-24 7:21
charlieg17-May-24 7:21 
AnswerRe: mfc, vs2022 compatible? Pin
Victor Nijegorodov17-May-24 7:39
Victor Nijegorodov17-May-24 7:39 
GeneralRe: mfc, vs2022 compatible? Pin
charlieg17-May-24 7:56
charlieg17-May-24 7:56 
AnswerRe: mfc, vs2022 compatible? Pin
RedDk17-May-24 9:39
RedDk17-May-24 9:39 
GeneralRe: mfc, vs2022 compatible? Pin
charlieg17-May-24 10:51
charlieg17-May-24 10:51 
GeneralRe: mfc, vs2022 compatible? Pin
RedDk17-May-24 11:11
RedDk17-May-24 11:11 
QuestionC++ language updates / old C++ code Pin
HobbyProggy14-May-24 20:12
professionalHobbyProggy14-May-24 20:12 
AnswerRe: C++ language updates / old C++ code Pin
CPallini15-May-24 1:48
mveCPallini15-May-24 1:48 
GeneralRe: C++ language updates / old C++ code Pin
HobbyProggy15-May-24 20:30
professionalHobbyProggy15-May-24 20:30 
AnswerRe: C++ language updates / old C++ code Pin
Maximilien15-May-24 2:03
Maximilien15-May-24 2:03 
GeneralRe: C++ language updates / old C++ code Pin
HobbyProggy15-May-24 20:37
professionalHobbyProggy15-May-24 20:37 
GeneralRe: C++ language updates / old C++ code Pin
k505415-May-24 5:38
mvek505415-May-24 5:38 
GeneralRe: C++ language updates / old C++ code Pin
HobbyProggy15-May-24 20:35
professionalHobbyProggy15-May-24 20:35 
AnswerRe: C++ language updates / old C++ code Pin
jschell15-May-24 14:29
jschell15-May-24 14:29 
GeneralRe: C++ language updates / old C++ code Pin
HobbyProggy15-May-24 20:41
professionalHobbyProggy15-May-24 20:41 
GeneralRe: C++ language updates / old C++ code Pin
jschell16-May-24 12:10
jschell16-May-24 12:10 
QuestionCan this be the cause of a memory leak Pin
Calin Negru9-May-24 2:50
Calin Negru9-May-24 2:50 
AnswerRe: Will this generate a memory leak Pin
Victor Nijegorodov9-May-24 3:05
Victor Nijegorodov9-May-24 3:05 
Calin Negru wrote:
do I need to delete the vector once the work is done?
for(int i=0;i<3;i++)
{
vector<thing*> * Nodes = new vector <thing*>();
thing * Athing = new thing();
Nodes->push_back(Athing);
//do stuff
Nodes->clear();
delete Nodes;
}

Yes, you do.
Since you created it (vector) with new then you need to delete the vector once the work is done

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.