Wrox Programmer Forums
|
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old November 7th, 2005, 06:20 PM
Registered User
 
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Vector problem

Hi, Im a beginner to C++ and can't work out these errors:
"File1.h": E2303 Type name expected at line 9
"File1.h": E2139 Declaration missing ; at line 9

this error is related to the line: vector<int> si;
which is in a header file. Please, if you know how I can solve this error I will be very happy, as I can't carry on with the rest of my coursework.

cheers,
ronnie
Reply With Quote
  #2 (permalink)  
Old November 7th, 2005, 07:55 PM
Authorized User
 
Join Date: Oct 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Could you show the surrounding lines of code? Did you include the correct headers to use vector?

----
Scott J. Kleper
Author, "Professional C++"
(Wrox, 2005)
Reply With Quote
  #3 (permalink)  
Old November 7th, 2005, 08:25 PM
Authorized User
 
Join Date: Nov 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Paramesh
Default

It is not possible to answer this without your code but here is a wild guess:

>>>"File1.h": E2303 Type name expected at line 9
Did you include <vector.h> ??

"File1.h": E2139 Declaration missing ; at line 9
You missed out a semicolon in the end of the line.

So, try including <vector.h> in the line and the error messages will go away.

Please post your code between code tags.

Regards,
Paramesh.

"Don't walk behind me; I may not lead.
 Don't walk in front of me; I may not follow.
 Just walk beside me and be my friend."
Reply With Quote
  #4 (permalink)  
Old November 9th, 2005, 08:18 AM
Registered User
 
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your help, I've solved the problem :-)
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
EJB implementation in Vector vikas sheel BOOK: Expert One-on-One J2EE Design and Development 0 April 2nd, 2005 09:14 AM
Transfering elements from a vector to another aldo_izzo J2EE 0 June 8th, 2004 04:44 PM
Trouble Using Vector Iain C++ Programming 0 April 7th, 2004 08:12 PM
Vector.contains(Object obj) jacob J2EE 2 January 10th, 2004 02:34 PM
vector.add(); chikodi Servlets 2 October 23rd, 2003 02:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.