I want to modify a specific object member of an array of objects. So I intend to pass the object member to a method that would iterate through the array and modify the specified member for each object:
Object *objs[10];
if (condition)
modify_all(objs, Object.x, set_value);
But I can't pass Object.x like that. Is there a better way of doing this? I need something like this, since modfiy_all doesn't know which member to modify.
EDIT: I'm just trying to refactor repetitive iterations of the array.