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 April 7th, 2004, 08:12 PM
Registered User
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trouble Using Vector

Hi,

I am having trouble trying to make a vector list work. I get an error (E2303 Type name expected)on the line where I declare the vector in the header file.

I would be greatful if anyone could explain why!

cheers Iain

//.h

#ifndef TestH
#define TestH

class TestC
{
      private:
      int tst;
      vector<Test*> *tests;

      public:
      Patient();
      int getTest();
      void addInts();
};

//.cpp

#include <system.hpp>
#include <vcl.h>
#include <StrUtils.hpp>
#include <algorithm>
#include <vector>
using namespace std;

#pragma hdrstop

#include "Test.h"
#include "Patient.h"


#pragma package(smart_init)

Patient::Patient()
{
    tst = 42;
    tests = new vector<Test*>;
}

int Patient::getTest()
{
    return tst;
}

void Patient::addInts()
{
    ints->insert( ints->end(), 24);
}








Similar Threads
Thread Thread Starter Forum Replies Last Post
Vector problem ronnie5 C++ Programming 3 November 9th, 2005 08:18 AM
EJB implementation in Vector vikas sheel BOOK: Expert One-on-One J2EE Design and Development 0 April 2nd, 2005 09:14 AM
Vector class php cslcs BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 3 March 12th, 2004 03:52 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.