I have variable mode, which I am declaring with the following line:
StatusRecord mode;
StatusRecord is a struct which holds several variables of different types.
I now want to create a pointer to mode, and populate that pointer with some data by using a function to populate its attributes/ fields. I have tried doing this as follows:
StatusRecord mode;
StatusRecord *modePtr = &mode;
DataStore->getModeData(*modePtr);
Here, I am declaring the struct variable, creating a pointer to it, and populating that pointer using the getModeData() function. However, I now want to use an attribute of the struct ptr I've just populated in a conditional statement:
if(*modePtr->eraseSelect ==2){
...
}
But I'm getting a compile error on this line that says:
Error: operand of '*' must be a pointer
Does this mean that the eraseSelect attribute should be a pointer as well as 'modePtr`? How would I fix this error?