Click here to Skip to main content
15,891,248 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Write int values in XML format Pin
Mark Salsbery12-Feb-08 6:02
Mark Salsbery12-Feb-08 6:02 
GeneralCommand Line Arguments of other processes Pin
Imtiaz Murtaza11-Feb-08 15:31
Imtiaz Murtaza11-Feb-08 15:31 
QuestionHow to copy vector? Pin
TooShy2Talk11-Feb-08 15:03
TooShy2Talk11-Feb-08 15:03 
GeneralRe: How to copy vector? Pin
Maximilien11-Feb-08 15:10
Maximilien11-Feb-08 15:10 
GeneralRe: How to copy vector? Pin
Chris Losinger11-Feb-08 15:40
professionalChris Losinger11-Feb-08 15:40 
GeneralRe: How to copy vector? Pin
Stephen Hewitt11-Feb-08 16:25
Stephen Hewitt11-Feb-08 16:25 
GeneralRe: How to copy vector? Pin
Chris Losinger12-Feb-08 1:05
professionalChris Losinger12-Feb-08 1:05 
GeneralRe: How to copy vector? Pin
Stephen Hewitt11-Feb-08 16:23
Stephen Hewitt11-Feb-08 16:23 
Simply use "=" or the copy constructor:
// VanillaConsole.cpp : Defines the entry point for the console application.
//
 
#include "stdafx.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
using namespace std;
 
int main()
{
	typedef vector<int> ints_t;
 
	// Populate a vector.
	ints_t first;
	first.push_back(1);
	first.push_back(2);
	first.push_back(3);
	first.push_back(4);
 
	// Print out the contents.
	typedef ostream_iterator<int> intout_t;
	cout << "First:" << endl;
	copy(first.begin(), first.end(), intout_t(cout, "\n"));
	cout << endl;
 
	// Copy the first vector.
	ints_t second = first;
 
	// Print out the contents.
	cout << "Second:" << endl;
	copy(second.begin(), second.end(), intout_t(cout, "\n"));
	cout << endl;
 
	return 0;
}


Steve

AnswerRe: How to copy vector? Pin
Programm3r11-Feb-08 19:35
Programm3r11-Feb-08 19:35 
Question[Message Deleted] Pin
1dayprogrammer11-Feb-08 13:45
1dayprogrammer11-Feb-08 13:45 
GeneralRe: colour transition Pin
Stephen Hewitt11-Feb-08 13:54
Stephen Hewitt11-Feb-08 13:54 
GeneralRe: colour transition Pin
Californian212-Feb-08 6:32
Californian212-Feb-08 6:32 
QuestionWhat is this called? Pin
Waldermort11-Feb-08 9:03
Waldermort11-Feb-08 9:03 
AnswerRe: What is this called? Pin
Mark Salsbery11-Feb-08 9:15
Mark Salsbery11-Feb-08 9:15 
GeneralRe: What is this called? Pin
Waldermort11-Feb-08 9:23
Waldermort11-Feb-08 9:23 
GeneralRe: What is this called? Pin
Mark Salsbery11-Feb-08 9:28
Mark Salsbery11-Feb-08 9:28 
GeneralRe: What is this called? Pin
Waldermort11-Feb-08 9:34
Waldermort11-Feb-08 9:34 
GeneralRe: What is this called? Pin
Mark Salsbery11-Feb-08 9:38
Mark Salsbery11-Feb-08 9:38 
AnswerRe: What is this called? Pin
krmed11-Feb-08 10:24
krmed11-Feb-08 10:24 
AnswerRe: What is this called? Pin
Michael Martin11-Feb-08 16:20
professionalMichael Martin11-Feb-08 16:20 
QuestionPostMessage failure. How best to proceed? Pin
Chris Meech11-Feb-08 8:38
Chris Meech11-Feb-08 8:38 
AnswerRe: PostMessage failure. How best to proceed? Pin
Nemanja Trifunovic11-Feb-08 8:50
Nemanja Trifunovic11-Feb-08 8:50 
GeneralRe: PostMessage failure. How best to proceed? Pin
Chris Meech11-Feb-08 9:48
Chris Meech11-Feb-08 9:48 
AnswerRe: PostMessage failure. How best to proceed? Pin
Mark Salsbery11-Feb-08 9:11
Mark Salsbery11-Feb-08 9:11 
GeneralRe: PostMessage failure. How best to proceed? Pin
Chris Meech11-Feb-08 9:53
Chris Meech11-Feb-08 9:53 

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.