Here is the EXACT Error given by Code::Blocks
D:\cpp\AdventureTimeTest\main.cpp|12|error: 'class adventure' has no member named 'drawMap'
Here is my code:-
In main.cpp
#include <iostream>
#include "adventure.h"
using namespace std;
int main()
{
adventure a;
a.setMapSize(10);
a.drawMap();
return 0;
}
In adventure.h
class adventure
{
public:
adventure();
virtual ~adventure();
int mapSize;
void setMapSize(int mapSize);
int getMapSize();
void drawMap();
protected:
private:
};
and, finally, in adventure.cpp
#include <iostream>
#include "adventure.h"
using namespace std;
adventure::adventure()
{
}
adventure::~adventure()
{
}
void adventure::setMapSize(int par1)
{
mapSize = par1;
}
int adventure::getMapSize()
{
return mapSize;
}
void adventure::drawMap()
{
for(int x = 0; x <= mapSize; x++)
{
for(int y = 0; y <= mapSize; y++)
{
cout << ". ";
}
cout << endl;
}
}
Thanks, hopefully I can get this issue resolved fairly quickly.