I have 3 classes that have been created
Map class
#ifndef MAP_H
#define MAP_H
#include "position.h"
#include "Entity.h"
#include <iostream>
#include <windows.h>
#include <ctime>
#include <iostream>
class Map
{
private:
char mapSize[21][21];
public:
Map();
~Map();
};
#endif
Entity class
#ifndef ENTITY_H
#define ENTITY_H
#include "Map.h"
class Entity
{
position pos;
public:
Entity();
~Entity();
};
#endif
position class
#ifndef POSITION_H
#define POSITION_H
#include "Map.h"
class position
{
public:
int x;
int y;
position();
~position();
};
#endif
It seems that the source of the error is from entity.h, specifically the line
position pos;
These classes, when compiled together, gives me two errors
1) C4430 - missing type specifier - int assumed. Note: C++ does not support default-int
2) C3646 - 'pos': unknown override specifier
I would like to know what is causing the issue, as I can't seem to figure out what the issue it
What I have tried:
Originally, in entity.h I had included position.h as well, but i removed it thinking that map.h was causing the loop. Apparently not.
FYI:
position pos;
was defined in public before, but it still did not work