Click here to Skip to main content

C / C++ / MFC

 
AnswerRe: I am Bemused about std::list<> PinmemberStephen Hewitt13-Nov-12 16:13 
QuestionPDF Accessing problem PinmemberBianChengNan12-Nov-12 18:22 
QuestionSendMessage(...) MFC is not working in win 7 enterprise edition Pinmembervikuseth12-Nov-12 9:02 
AnswerRe: SendMessage(...) MFC is not working in win 7 enterprise edition PinmvpRichard MacCutchan12-Nov-12 10:11 
GeneralRe: SendMessage(...) MFC is not working in win 7 enterprise edition Pinmembervikuseth12-Nov-12 10:29 
GeneralRe: SendMessage(...) MFC is not working in win 7 enterprise edition PinmvpRichard MacCutchan12-Nov-12 10:35 
GeneralRe: SendMessage(...) MFC is not working in win 7 enterprise edition Pinmembervikuseth12-Nov-12 10:39 
GeneralRe: SendMessage(...) MFC is not working in win 7 enterprise edition PinmvpRichard MacCutchan13-Nov-12 0:01 
QuestionRe: SendMessage(...) MFC is not working in win 7 enterprise edition PinmemberDavidCrow12-Nov-12 11:18 
AnswerRe: SendMessage(...) MFC is not working in win 7 enterprise edition Pinmembervikuseth12-Nov-12 23:07 
AnswerRe: SendMessage(...) MFC is not working in win 7 enterprise edition Pinmembervikuseth14-Nov-12 2:04 
QuestionDoes this way to clear all item from std::map have problem? Pingroupyu-jian11-Nov-12 2:47 
AnswerRe: Does this way to clear all item from std::map have problem? PinmvpRichard MacCutchan11-Nov-12 7:18 
GeneralRe: Does this way to clear all item from std::map have problem? Pingroupyu-jian11-Nov-12 20: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 22:35 
GeneralRe: Does this way to clear all item from std::map have problem? PinmemberStephen Hewitt12-Nov-12 2:43 
GeneralRe: Does this way to clear all item from std::map have problem? Pingroupyu-jian12-Nov-12 4:06 
QuestionGetting pasted test PinmemberHadi Dayvary10-Nov-12 5:20 
AnswerRe: Getting pasted test PinmvpRichard MacCutchan10-Nov-12 7:05 
GeneralRe: Getting pasted test PinmemberHadi Dayvary10-Nov-12 21:29 
GeneralRe: Getting pasted test PinmvpRichard MacCutchan10-Nov-12 22:27 
Questionhow can get a disk number of a logical drive? PinmemberLe@rner9-Nov-12 20:42 
AnswerRe: how can get a disk number of a logical drive? PinmvpRichard MacCutchan10-Nov-12 0:28 
GeneralRe: how can get a disk number of a logical drive? PinmemberLe@rner10-Nov-12 1:05 
GeneralRe: how can get a disk number of a logical drive? PinmvpRichard MacCutchan10-Nov-12 1:11 
AnswerRe: how can get a disk number of a logical drive? PinmemberAndré Kraak10-Nov-12 1:18 
QuestionInfix to Postfix Converter PinmemberShayanTanwir9-Nov-12 18:52 
AnswerRe: Infix to Postfix Converter PinmvpRichard MacCutchan10-Nov-12 0:27 
AnswerRe: Infix to Postfix Converter PinmemberDavidCrow11-Nov-12 16:59 
QuestionHow to stop typing in CDateTimeCtrl in MFC Pinmemberrahul.kulshreshtha7-Nov-12 17:47 
AnswerRe: How to stop typing in CDateTimeCtrl in MFC PinmemberJochen Arndt8-Nov-12 0:32 
GeneralRe: How to stop typing in CDateTimeCtrl in MFC Pinmemberrahul.kulshreshtha8-Nov-12 6:52 
GeneralRe: How to stop typing in CDateTimeCtrl in MFC PinmemberJochen Arndt8-Nov-12 7:32 
Question[MFC] How to save three ini files as zip file? Pingroupyu-jian7-Nov-12 6:20 
AnswerRe: [MFC] How to save three ini files as zip file? Pinmemberjeron17-Nov-12 7:17 
AnswerRe: [MFC] How to save three ini files as zip file? PinmemberProgramFOX7-Nov-12 8:35 
QuestionWhy new Image failed? Pingroupyu-jian7-Nov-12 5:06 
AnswerRe: Why new Image failed? PinmemberAndrew Cherednik7-Nov-12 13:12 
AnswerRe: Why new Image failed? PinmemberSanthosh G_7-Nov-12 13:59 
GeneralRe: Why new Image failed? Pingroupyu-jian15-Nov-12 17:41 
QuestionDialogBox fail in XP PinmemberWilliam Engberts7-Nov-12 4:32 
QuestionRe: DialogBox fail in XP PinmvpCPallini7-Nov-12 11:06 
AnswerRe: DialogBox fail in XP PinmemberAndrew Cherednik7-Nov-12 13:20 
GeneralRe: DialogBox fail in XP PinmemberWilliam Engberts7-Nov-12 23:36 
SuggestionRe: DialogBox fail in XP PinmemberAndrew Cherednik7-Nov-12 23:59 
GeneralRe: DialogBox fail in XP PinmemberWilliam Engberts8-Nov-12 0:30 
QuestionRe: DialogBox fail in XP PinmemberDavidCrow8-Nov-12 5:21 
AnswerRe: DialogBox fail in XP PinmemberWilliam Engberts8-Nov-12 6:00 
QuestionAdo problem Pinmemberluckyty6-Nov-12 23:27 
Questionhow I can allow user draw curve using mouse PinmemberMember 94819416-Nov-12 8:06 

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
Web01 | 2.8.150326.1 | Last Updated 26 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid