delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/11/02/09:54:44

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: Fw: Please help, Problem using vector,
X-Mailer: NeoMail 1.26
X-IPAddress: 68.192.64.186
MIME-Version: 1.0
Message-Id: <E1AGJc8-0008JM-Ig@t8.cwihosting.com>
Date: Sun, 02 Nov 2003 08:54:00 -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

------------- Forwarded message follows -------------


------------- Forwarded message follows -------------

Could someone please advise me what I’m doing wrong.  I’m trying to 
use vector in a simple program.  I'm using this command to compile 

                     gxx -Wall -o vectorTest.exe vectorTest.cpp

But I get these errors:

>>>>>>>>>>>>>>>>>>>>>>>>>>>> error <<<<<<
vectorTest.cpp: In function `int main()':
vectorTest.cpp:11: error: `vector' undeclared (first use this function)
vectorTest.cpp:11: error: (Each undeclared identifier is reported only 
once for
each function it appears in.)
vectorTest.cpp:11: error: parse error before `(' token
.>>>>>>>>>>>>>>>>>>error <<<<<<<<<<<<<<<<<<<<<<<<<

Here is the relevant part of the code, the error happens on the line I 
noted with ****

>>>>> snip <<<<<<<<<<
#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
>>>>> snip <<<<<<<<<<

Thank you so much in advance


-- 





-- 





-- 

- Raw text -


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