delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/11/03/22:08:50

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "leila" <gcceducate AT tutorialwizard DOT net>
To: djgpp AT delorie DOT com
Subject: Re: Please help, Problem using vector,
X-Mailer: NeoMail 1.26
X-IPAddress: 68.192.64.186
MIME-Version: 1.0
Message-Id: <E1AGrXk-00060L-DG@t8.cwihosting.com>
Date: Mon, 03 Nov 2003 21:07:44 -0600
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - t8.cwihosting.com
X-AntiAbuse: Original Domain - delorie.com
X-AntiAbuse: Originator/Caller UID/GID - [512 529] / [47 12]
X-AntiAbuse: Sender Address Domain - t8.cwihosting.com
Reply-To: djgpp AT delorie DOT com

Thank you all for helping me out, 
 
I had copied this from some website but I probably made a mistake when I
was doing it. I didn't see the problem because I am new to STL, not c++,
and I didn't expect any errors in the code. 
 
Again I thank every one for being patient and letting me know about the
code problem.  I hope my next question will be more intelligent.



> 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