Greetings from a new member. I am so glad that I found this forum, which is an excellent source for learning. Can someone help me with this task:


I have an array of structs:


Code:
typedef struct {
    int id;
    String topic;
    float value;
}myStruct;


// then create array of struct and add some values
myStruct myArray []= {
    {1, "topic1", 26},
    {2, "topic2", 27},
    {3, "topic3", 31},
 
};
In rest of my code I have another varibales with fresh value (it changes in a certain period of time), lets say float topic1freshvalue....
What I'm trying to do, but I don't know if it's possible, is to create a pointer inside the structure (*myStruct.value) that will point to the variable outside, let say ptr-variable, then to assign a value, IE
myarray[0].mystruct.value=ptr-variable
topic1freshvalue=ptr-variable:


so that whenever the topic1freshvalue variable changes its value, the same is reflected on the value in the structure.
In short, I want to change the value of topic1 from 26 to new value that hold topic1freshvalue float variable.