This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with updating/reading Structure pointer member using functions

Hi everyone,

I want to update a structure member using a function and read it in other functions;

anyone helpp?

typedef struct
{
   uint32_t Update;

}StructUpdate;

StructUpdate Objstr, *Objstrpoint = &Objstr;


void Program()
{
   Objstrpoint->Update = 14;
}

void Read1()
{
   if(Objstr.Update == 14)//doesnt work!
   ...
}

void Read2()
{
   if(Objstr.Update == 15)//doesnt work!
   ...
}

void Read3()
{
   if(Objstr.Update == 16)//doesnt work!
   ...
}
        .
        .
        .
        .
        .

int main()

{

   if(Objstr.Update == 14)//this also doesnt work!

}

0