Hello!
I want to make third function operating with elements of m1[5].
Please, how do I achieve that array m1[5] can be memorised and translated to another function?
)f.e. , third function could multiply each elemnt of m1[5] by 3 and then add them all and count the sum, but it is just example).
The point is just how the array can be memorised and translated to toher functions.
Please, if someone can help!!!
Many thanks!!!
In other words: your main reserves 'm' and calls Generate. It should similarly reserve an 'int [5]' and pass it to Array1d as second parameter.
The other option is dynamic memory allocation. Standard library offers containers, like std::vector and std::array. Containers are objects. Functions can return objects.