I have a function with the following signature:
void foo (char **bar);
'bar' is an array of strings with an unknown length.
I need to write a loop checking if every string in 'bar' holds some property, without knowing how many elements are in this array.
I've seen multiple articles saying that this is easy if my signature is either of the following:
void foo (char *bar[LENGTH]);
void foo (char bar[LENGTH01][LENGTH02]);
EDIT: My original question had both of these signatures not contain a hash-defined length, they have been added for clarity.
(I could get the length of the above through sizeof(bar)/sizeof(bar[0])
).
Unfortunately, the signature of this function is already defined, and I can't modify it.
Is it still possible to create (for example) a for loop which goes through each string of this array, or is this impossible?