I have a function that takes a pointer to an array of structs
typedef struct {
bool isUsed;
int count;
} MyStructure;
void Process(MyStructure *timeStamps, int arrayLength){
for (int i = 0; i < arrayLength; i++){
MyStructure *myStructure = &(*(timeStamps + i));
if (myStructure->isUsed == true){
/*do something*/
}
}
}
The way that I am accessing the array seems to be a little off.
&(*(timeStamps + i))
Is there a better way to do this?