Hi!
I don't understand why I can't use my functions declared like this:
#include "groundArray.h"
int groundArray::getlistX(int i)
{
return x;
}
int groundArray::getlistY(int i)
{
int groundlistY[] = {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100};
return groundlistY[i];
}
int groundArray::getlistWidth(int i)
{
int groundlistWidht[] = {40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40};
return groundlistWidht[i];
}
int groundArray::getlistHeight(int i)
{
int groundlistHeight[] = {40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40};
return groundlistHeight[i];
}
With the header file
#ifndef GROUNDARRAY_H
#define GROUNDARRAY_H
class groundArray
{
public:
groundArray();
virtual ~groundArray();
static int getlistX(int i);
static int getlistY(int i);
static int getlistWidth(int i);
static int getlistHeight(int i);
const static int x = 89;
protected:
private:
};
#include "masterList.h"
#include "groundArray.h"
int* masterList::list(void)
{
int* pointer;
int list[size*2];
pointer=list;
for(int i = 0; i<size; i+=2)
{
list[i] = getlistX(i);
list[i+1] = getlistY(i);
}
return pointer;
}
int masterList::getSize(void)
{
return size;
}
I get the error message: masterList.cpp|11|error: ‘getlistX’ was not declared in this scope|. Why?
MasterList is supposed to make the coordinates for the ground available as an array within main() later.