static char* array[10];
static int other_array[10];
void get_values(int n)
{
for (i = 0; i < n; i++)
other_array[i] = get_val(array[i]);
}
int main (void) {
array[0] = "somestring";
array[1] = "some other string"
array[2] = "lalala"
array[3] = "bananas"
get_values(4);
for (i = 0; i < 4; i++)
blah(other_array[i]);
return 0;
}
If you think of writing code like that, don't. Google for function parameters and try to understand how they work. Some poor sod will eventually have to figure out wtf you're trying to do [1]. I've encountered this bit of code a few weeks back and I am still flabbergasted.
/me hopes this venting makes the anger go away.
[1] as I stated in an early post, any software project is a collaborative project. It has at least two developers [...]. The person you may end up hating for the above may be you.