Click here to Skip to main content
       

C / C++ / MFC

 
GeneralRe: SendMessage(...) MFC is not working in win 7 enterprise edition Pinmembervikuseth12-Nov-12 9:39 
GeneralRe: SendMessage(...) MFC is not working in win 7 enterprise edition PinmvpRichard MacCutchan12-Nov-12 23:01 
QuestionRe: SendMessage(...) MFC is not working in win 7 enterprise edition PinmemberDavidCrow12-Nov-12 10:18 
AnswerRe: SendMessage(...) MFC is not working in win 7 enterprise edition Pinmembervikuseth12-Nov-12 22:07 
AnswerRe: SendMessage(...) MFC is not working in win 7 enterprise edition Pinmembervikuseth14-Nov-12 1:04 
QuestionDoes this way to clear all item from std::map have problem? Pingroupyu-jian11-Nov-12 1:47 
AnswerRe: Does this way to clear all item from std::map have problem? PinmvpRichard MacCutchan11-Nov-12 6:18 
GeneralRe: Does this way to clear all item from std::map have problem? Pingroupyu-jian11-Nov-12 19:50 
Hi,
 
Thank you for your replay, after see this article, I find that I am right.
Thankyou a lot.
 
#include "stdafx.h"

#include <list>
#include <iostream>

int main( ) 
{
	using namespace std;
	list <int> c1;
	list <int>::iterator Iter;
 
	c1.push_back( 10 );
	c1.push_back( 20 );
	c1.push_back( 30 );
	c1.push_back( 40 );
	c1.push_back( 50 );
	cout << "The initial list is:";
	for ( Iter = c1.begin( ); Iter != c1.end( ); Iter++ )
		cout << " " << *Iter;
	cout << endl;
 
	std::list<int>::iterator iter;
	std::list<int>::iterator iter2Delete;
	for(iter = c1.begin(); iter != c1.end();)
	{
		iter2Delete = iter++;
		c1.erase(iter2Delete);
	}
 
	for (Iter = c1.begin( ); Iter != c1.end( ); Iter++ )
		cout << " " << *Iter;
	cout << endl;
}

GeneralRe: Does this way to clear all item from std::map have problem? PinmvpRichard MacCutchan11-Nov-12 21:35 
GeneralRe: Does this way to clear all item from std::map have problem? PinmemberStephen Hewitt12-Nov-12 1:43 
GeneralRe: Does this way to clear all item from std::map have problem? Pingroupyu-jian12-Nov-12 3:06 
QuestionGetting pasted test PinmemberHadi Dayvary10-Nov-12 4:20 
AnswerRe: Getting pasted test PinmvpRichard MacCutchan10-Nov-12 6:05 
GeneralRe: Getting pasted test PinmemberHadi Dayvary10-Nov-12 20:29 
GeneralRe: Getting pasted test PinmvpRichard MacCutchan10-Nov-12 21:27 
Questionhow can get a disk number of a logical drive? PinmemberLe@rner9-Nov-12 19:42 
AnswerRe: how can get a disk number of a logical drive? PinmvpRichard MacCutchan9-Nov-12 23:28 
GeneralRe: how can get a disk number of a logical drive? PinmemberLe@rner10-Nov-12 0:05 
GeneralRe: how can get a disk number of a logical drive? PinmvpRichard MacCutchan10-Nov-12 0:11 
AnswerRe: how can get a disk number of a logical drive? PinmemberAndré Kraak10-Nov-12 0:18 
QuestionInfix to Postfix Converter PinmemberShayanTanwir9-Nov-12 17:52 
AnswerRe: Infix to Postfix Converter PinmvpRichard MacCutchan9-Nov-12 23:27 
AnswerRe: Infix to Postfix Converter PinmemberDavidCrow11-Nov-12 15:59 
QuestionHow to stop typing in CDateTimeCtrl in MFC Pinmemberrahul.kulshreshtha7-Nov-12 16:47 
AnswerRe: How to stop typing in CDateTimeCtrl in MFC PinmemberJochen Arndt7-Nov-12 23:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 30 Aug 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid