delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/11/03/09:46:19

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Thomas8675309 AT yahoo DOT com (Tom)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Please help, Problem using vector,
Date: 3 Nov 2003 06:42:49 -0800
Organization: http://groups.google.com
Lines: 33
Message-ID: <7b68d58f.0311030642.1c78ca55@posting.google.com>
References: <E1AFhRk-0000uP-TR AT t8 DOT cwihosting DOT com> <bo596p$hcp$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
NNTP-Posting-Host: 63.72.148.162
X-Trace: posting.google.com 1067870569 15888 127.0.0.1 (3 Nov 2003 14:42:49 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Mon, 3 Nov 2003 14:42:49 +0000 (UTC)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> wrote:

> leila <gcceducate AT tutorialwizard DOT net> wrote:
> 
> > #include <iostream>
> > #include <vector>
> > using namespace std;
> > int main()
> > {
> > 	int val[10] = {1,2,2,2,2,4,7,8,9,6};
> > 	int saveVal;
> > 	vector v1(val, val+10);    // **** This is where the error starts
> 
> Throw away whatever book or tutorial made you think this is a correct
> usage of the stuff declared in standard header <vector>, and replace
> it by a usable C++ textbook.  

The OP's example code wasn't that far off - she just omitted the type
specialization when she declared v1.  That's a pretty common typo, and
I'm not sure it justifies throwing away the book (although I agree
that a disturbingly high percentage of C++ books are pretty bad and
deserve to be thrown away).


> The people over in comp.lang.c++ (where
> this question really belongs, since it has no particular relation to
> DJGPP) will have a list of usable ones in their FAQ list.

Agreed, on both counts.

Best regards,

Tom

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019