If I declare an array (using c++ Class Template) like this,
#include <array> //standard c++ library
int main()
{
array<int,3> myarray{10,20,30};
}
How will I be able to send this array object to a function as a parameter.
If I pass like this it works :
void f_print(array<int, 3> object){}
int main()
{
array<int, 3> myarray{10,20,30};
f_print(myarray);
}
but the problem here is I am hard coding the size in the function. The whole point to work like this to use array as an object type so I can use array.size(). So How can I pass this array type object (c++ Class Template) without hardcoding the size.
Edit_1: Why can't I send the array object as only an object where I use all the properties of the object inside the function parameter.