I am confused about which syntax to use if I want to pass an array of known or unknown size as a function parameter.
Suppose I have these variants for the purpose:>
Note that in C++, if the length of the array is known at compile time (for example if you passed a string literal), you can actually get its size:
template void func(const char(&str)[N]) { // Whatever... } int main() { func("test"); // Works, N is 5 }