data.h
namespace Data{
class Enviroment{
private:
struct EnviromentData {
float temprature;
float pressure;
float light;
};
public:
float ReturnTemprature();
float ReturnPressure();
float ReturnLight();
void SetTemprature(float);
void SetPressure(float);
void SetLight(float);
void SetAll(float, float, float);
};
};
data.cpp
#include "data.h"
struct EnviromentData envData;
float ReturnTemprature(){
return envData.temprature;
}
float ReturnPressure(){
return envData.pressure;
}
float ReturnLight(){
return envData.light;
}
void Set(float temprature, float pressure, float light){
envData.temprature = temprature;
envData.pressure = pressure;
envData.light = light;
}
On the line struct EnvirometnData envData;
I have the
error Variable has incomplete type 'struct EnviromentData'
I'm not sure what I have done wrong, my implementation is based of the top answer to this stackover question