I'm new to using vectors and some may see this as a trivial problem. If you have any suggestion on how I can improve the program, I welcome your input.
code(with problem):
#ifndef CMONOPOLY_HPP
#define CMONOPOLY_HPP
#include <vector>
#include "head.hpp"
namespace CMonopoly
{
class CMonopoly
{
public:
~CMonopoly();
void PrintWelcome();
void SetUpPlayers();
void FillBoard();
private:
void CreateSpecial(char a[]);
void CreateSquare(char a[], const int SIZE);
vector<CBoard *> Board;
vector<CPlayers *> Players;
};
}
#endif
Error message:
1>------ Build started: Project: MonopolyGame, Configuration: Debug Win32 ------
1>Build started 23/02/2012 08:25:04.
1>InitializeBuildStatus:
1> Touching "Debug\MonopolyGame.unsuccessfulbuild".
1>ClCompile:
1> main.cpp
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C2143: syntax error : missing ';' before '<'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C2238: unexpected token(s) preceding ';'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C2143: syntax error : missing ';' before '<'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C2238: unexpected token(s) preceding ';'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\main.cpp(6): error C2882: 'CMonopoly' : illegal use of namespace identifier in expression
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\main.cpp(6): error C2065: 'monopoly' : undeclared identifier
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\main.cpp(6): error C2061: syntax error : identifier 'CMonopoly'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\main.cpp(8): error C2065: 'monopoly' : undeclared identifier
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\main.cpp(8): error C2227: left of '->PrintWelcome' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\main.cpp(9): error C2065: 'monopoly' : undeclared identifier
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\main.cpp(9): error C2227: left of '->SetUpPlayers' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\main.cpp(10): error C2065: 'monopoly' : undeclared identifier
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\main.cpp(10): error C2227: left of '->FillBoard' must point to class/struct/union/generic type
1> type is ''unknown-type''
1> CSquare.cpp
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C2143: syntax error : missing ';' before '<'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C2238: unexpected token(s) preceding ';'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C2143: syntax error : missing ';' before '<'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C2238: unexpected token(s) preceding ';'
1> CSpecial.cpp
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C2143: syntax error : missing ';' before '<'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C2238: unexpected token(s) preceding ';'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C2143: syntax error : missing ';' before '<'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C2238: unexpected token(s) preceding ';'
1> CPlayers.cpp
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C2143: syntax error : missing ';' before '<'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C2238: unexpected token(s) preceding ';'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C2143: syntax error : missing ';' before '<'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C2238: unexpected token(s) preceding ';'
1> CMonopoly.cpp
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C2143: syntax error : missing ';' before '<'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C2238: unexpected token(s) preceding ';'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C2143: syntax error : missing ';' before '<'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C2238: unexpected token(s) preceding ';'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(16): error C2065: 'Board' : undeclared identifier
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(16): error C2228: left of '.end' must have class/struct/union
1> type is ''unknown-type''
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(16): error C2065: 'Board' : undeclared identifier
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(16): error C2228: left of '.start' must have class/struct/union
1> type is ''unknown-type''
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(18): error C2065: 'Board' : undeclared identifier
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(21): error C2065: 'Board' : undeclared identifier
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(21): error C2541: 'delete' : cannot delete objects that are not pointers
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(23): error C2065: 'Player' : undeclared identifier
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(23): error C2228: left of '.end' must have class/struct/union
1> type is ''unknown-type''
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(23): error C2065: 'Player' : undeclared identifier
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(23): error C2228: left of '.start' must have class/struct/union
1> type is ''unknown-type''
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(25): error C2065: 'Player' : undeclared identifier
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(28): error C2065: 'Player' : undeclared identifier
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(28): error C2541: 'delete' : cannot delete objects that are not pointers
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(71): error C2065: 'Board' : undeclared identifier
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(71): error C2228: left of '.push_back' must have class/struct/union
1> type is ''unknown-type''
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(101): error C2065: 'Board' : undeclared identifier
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.cpp(101): error C2228: left of '.push_back' must have class/struct/union
1> type is ''unknown-type''
1> CBoard.cpp
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cspecial.hpp(7): error C2504: 'CBoard' : base class undefined
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\csquare.hpp(7): error C2504: 'CBoard' : base class undefined
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C2143: syntax error : missing ';' before '<'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(19): error C2238: unexpected token(s) preceding ';'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C2143: syntax error : missing ';' before '<'
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\\lha-003\pers-h\0005c42b\downloads\kzaman (1)\kzaman\monopolygame\cmonopoly.hpp(20): error C2238: unexpected token(s) preceding ';'
1> Generating Code...
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:07.12
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========