The main problem I\'m having is having so many parameters, which I just want to get rid of, and yes I do not understand the logic of structs. However, it is becoming a bit more
typedef struct _foo
{
int x1, x2, x3,..., x20;
} foo;
int add(const foo *pBar)
{
return pBar->x1 + pBar->x2 + pBar->x3 + ... + pBar->x20;
}
int main()
{
// declare and initialize the struct
foo bar = { 1, 2, 3, ..., 20 };
// an alternative way of initializing the struct:
bar.x1 = 1;
bar.x2 = 2;
bar.x3 = 3;
:
bar.x20 = 20;
int total = add(&bar);
}