2. Function Arguments Specification
Passing Static Array as an Argument of the Function
In C++, a static array is an array whose size is determined at compile time and remains constant throughout the program's execution.
Like values with simple data types, we can pass arrays as function arguments!
Pass 1-dimensional array as an argument
To pass a 1-dimensional array as an argument of the function, we have to use
 brackets after the variable name inside the function signature:
processArray()function takes a 1-dimensional static array as its first argument.
int arrconstriction to declare that we will pass an array that consists of integer values as an argument of the function.
main()block, we use the name of an array without any additional operators as an argument of the
Pass a 2-dimensional array as an argument
Passing a 2-dimensional array is very similar to passing a 1-dimensional array: we have to use the
 after the variable name.
But there is one important difference: in C++, you cannot directly pass a 2D array using the syntax
datatype arrayName as a function argument.
When you pass a 2D array to a function, you need to specify the size of at least one array dimension inside the
 brackets. This is because C++ requires knowing the size of the dimension to calculate memory offsets when accessing elements in the array properly.
int matrixspecifies that the function
processMatrix()accepts a 2D array where the number of columns is fixed at
3. The number of rows is not specified because C++ can deduce it from the array passed to the function (but it is still passed as another argument,
rows, to let us iterate this array).
Since we need to specify at least one of the array dimensions (it doesn’t matter which), the signature of this function can also look like this:
When we call the function inside the
main() block, we use the name of an array as an argument without any additional operators.
Everything was clear?