Take the 2-minute tour ×  I have a C function named
SetParams(...) with a variable number of arguments. This
function sets up a static data structure (let us name it Data).
SetParams is used with pairs of arguments, e.g.
SetParams("paramA", paramA_value, "paramB", paramB_value) etc.
It can also be called many times, e.g.  SetParams("paramA",
paramA_value); SetParams("paramB", paramB_value);  When all
'parameters' have been set, another function is called (let us
name it Execute) that takes no args:  // uses data from static
'Data' and performs error_handling and execution  I was
wondering if I could structure this kind of code in a more
object-oriented way. So, I would like some advice, especially
for error-handling, since some pairs of args may contradict
others.  share|improve this question What exactly are you trying
to do? Any reason you don't just call "SetParams" multiple times
and push the results on to a stack before calling execute which
pops everything off the stack and uses them? –  Goz Aug 11 '09