View Single Post
  #1 (permalink)  
Old April 7th, 2004, 08:12 PM
Iain Iain is offline
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);
}