Ksmiler
Member
I'm having trouble reading values from an array of predefined structs.
Here's the code containing the structs' information and its data. This is stored in an .h file
Problem is, when I want to read a value from the stuct's arrays (for example KeyObj[1]._value), it will nearly always get the values wrong
To check which value was retrieved, I did sprintf(msg, "Value: %d", KeyObj[1]._value).
Is there like a special way to get a value from a predefined struct that I have missed to do? :huh:
Here's the code containing the structs' information and its data. This is stored in an .h file
Code:
#define OBJRKEY 100
#define OBJGKEY 200
#define OBJBKEY 300
#define OBJYKEY 400
struct tKEYOBJ
{
int _pX;
int _pY;
int _objtype;
int _value;
int _status;
};
struct tKEYOBJ KeyObj[6] =
{
{272,368,300,1,1},
{272,432,300,1,1},
{400,368,100,2,1},
{368,592,200,2,1},
{176,336,400,1,1},
{496,336,400,1,1},
};
Problem is, when I want to read a value from the stuct's arrays (for example KeyObj[1]._value), it will nearly always get the values wrong
To check which value was retrieved, I did sprintf(msg, "Value: %d", KeyObj[1]._value).
Is there like a special way to get a value from a predefined struct that I have missed to do? :huh: