I am writing an API that updates a LOT of different fields in a structure.
I could help the addition of future fields by making the update function variadic:
<
One problem with varargs in C is that you don't know how many arguments are passed, so you need that as another parameter:
update(2, FIELD_NAME1, 10, FIELD_NAME2, 20); update(3, FIELD_NAME1, 10, FIELD_NAME2, 20, FIELD_NAME3, 30);