Click here to Skip to main content
15,907,687 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Need assistance accessing FMTID Pin
Jeffrey Walton1-Nov-05 14:02
Jeffrey Walton1-Nov-05 14:02 
GeneralRe: Need assistance accessing FMTID Pin
KaptinKrunch1-Nov-05 16:47
KaptinKrunch1-Nov-05 16:47 
GeneralRe: Need assistance accessing FMTID Pin
Jeffrey Walton2-Nov-05 2:40
Jeffrey Walton2-Nov-05 2:40 
GeneralRe: Need assistance accessing FMTID Pin
KaptinKrunch3-Nov-05 5:00
KaptinKrunch3-Nov-05 5:00 
GeneralRe: Need assistance accessing FMTID Pin
Jeffrey Walton3-Nov-05 9:21
Jeffrey Walton3-Nov-05 9:21 
QuestionComplete Vector elements deletion Pin
itkid1-Nov-05 6:28
itkid1-Nov-05 6:28 
AnswerRe: Complete Vector elements deletion Pin
Maximilien1-Nov-05 6:34
Maximilien1-Nov-05 6:34 
AnswerRe: Complete Vector elements deletion [edited] Pin
toxcct1-Nov-05 6:36
toxcct1-Nov-05 6:36 
std::vector<>::clear() just set the vector empty.

you would have to iterate on each element of you container to delete it first, the call clear()

for example :
std::vector<Item*> m_cache;
std::vector<Item*>::iterator m_iterator;
for (m_iterator = m_cache.begin(); m_iterator != m_cache.end(); m_iterator++) {
    delete (*m_iterator);
}
m_cache.clear();


another solution, much object oriented however, would be to create you how vector-derived type, and overload the clear() function with the code above...



TOXCCT >>> GEII power
[toxcct][VisualCalc]

-- modified at 12:37 Tuesday 1st November, 2005
GeneralRe: Complete Vector elements deletion [edited] Pin
itkid1-Nov-05 7:44
itkid1-Nov-05 7:44 
GeneralRe: Complete Vector elements deletion [edited] Pin
Kevin McFarlane1-Nov-05 10:15
Kevin McFarlane1-Nov-05 10:15 
QuestionDNS program Pin
c++code1011-Nov-05 5:54
c++code1011-Nov-05 5:54 
QuestionGoogolplex Program Pin
ericelysia1-Nov-05 5:03
ericelysia1-Nov-05 5:03 
AnswerRe: Googolplex Program Pin
Maximilien1-Nov-05 5:32
Maximilien1-Nov-05 5:32 
AnswerRe: Googolplex Program Pin
David Crow1-Nov-05 5:38
David Crow1-Nov-05 5:38 
GeneralRe: Googolplex Program Pin
ericelysia1-Nov-05 5:56
ericelysia1-Nov-05 5:56 
GeneralRe: Googolplex Program Pin
toxcct1-Nov-05 6:23
toxcct1-Nov-05 6:23 
GeneralRe: Googolplex Program Pin
David Crow1-Nov-05 7:14
David Crow1-Nov-05 7:14 
AnswerRe: Googolplex Program Pin
toxcct1-Nov-05 6:13
toxcct1-Nov-05 6:13 
GeneralRe: Googolplex Program Pin
ericelysia1-Nov-05 6:22
ericelysia1-Nov-05 6:22 
GeneralRe: Googolplex Program Pin
toxcct1-Nov-05 6:29
toxcct1-Nov-05 6:29 
GeneralRe: Googolplex Program Pin
ericelysia1-Nov-05 6:39
ericelysia1-Nov-05 6:39 
Questionget bit rate supported by a portable device Pin
decang1-Nov-05 5:00
decang1-Nov-05 5:00 
QuestionLooking for API method to find component version ... Pin
Yanshof1-Nov-05 4:00
Yanshof1-Nov-05 4:00 
AnswerRe: Looking for API method to find component version ... Pin
Chris Losinger1-Nov-05 4:44
professionalChris Losinger1-Nov-05 4:44 
Questionif (23 == x) or if (x == 23) Pin
Anorexic Tribble1-Nov-05 2:58
Anorexic Tribble1-Nov-05 2:58 

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.