defining struct as global variable

Dear friends,

I am new with the dynamic c… this is my code…
typedef struct THERMOSTATS_INFO {
WORD BlockNumber;
BYTE Branch;
BYTE Address;
BYTE Setpoint_Celcius;
BYTE Setpoint_Fahrenheit;
BYTE FanSpeedAndModes;
BYTE Callibration;
BYTE KeyCard;
BYTE Function;
BYTE Minute;
BYTE Hour;

static ETOP_Thermostats TemporaryResult;

void setData(void);




void setData(){
/* this line –> */ TemporaryResult->BlockNumber = 0;

when i compile it is no error if i am remove any setData relation. but if i pres F9 or run it say runtimeerror…

is it wrong?

what i supposed to do?

Best Regards,

TemporaryResult is a structure, not a pointer. Try:

TemporaryResult.BlockNumber = 0;

Seems like the compiler should have complained about this…

it’s work!!

thank you sgt :smiley: