I have come across some C code that compiles, but I do not understand why. Specifically, I have a C library that has a lot of code using this format:
void ge
The reason it works in C, but not in C++ is simply because it's C code and not C++. The two languages share a history, not a grammar.
The C++ method to pass variable-sized arrays is std::vector, probably by reference if you intend to modify the vector in the function, or by const reference if you don't.