in Parameter?
you can't, unless you specify the size in the parameter declaration
If you want to pass array around, just include <array> and use std::array. It's actually quite easy to use. https://en.cppreference.com/w/cpp/container/array
add an extra * void fun(int arr[5]); -> arr is of type int * void fun(int (*arr)[5]); -> arr is of type int (*)[5] now declare an array of type int[5] int test[5]; fun(&test); now you can do sizeof (*arr) inside the function, but obviously the size will be the constant 5 * sizeof (int)
why you need to do that?
Обсуждают сегодня