Hi All,
Whilst trying to use an instance of a struct in my class I keep getting this error when I compile:
error: request for member 'Position' in 'obj', which is of non-class type 'MyClass ()()'
In my .imo file I have:
#include "MyClass.h"
void setup()
{
MyClass obj();
obj.Position.X = 10;
obj.Position.Y = 10;
}
void loop()
{
}
In my MyClass.cpp is:
#include "MyClass.h"
MyClass::MyClass()
{
}
And in MyClass.h is:
#ifndef MyClass_h
#define MyClass_h
struct MyStruct
{
int X;
int Y;
};
class MyClass
{
public:
MyStruct Position;
MyClass();
protected:
};
#endif
I can't see anything obvious that's wrong with it, all I'm trying to do is set the property of a struct instance but get this error, any ideas?
Thanks!