I am just playing around with std::array. Want to pass an array of integers to a function which can easily be done using
void arrayByValue(array<int, 5> arr);
The above can be invoked like
array<int, 5> aInt = {100,92,-1,122,112};
arrayByValue(aInt);
This works perfectly fine as long as it is in same .cpp file.
I am The issue is how to put this in a .h file, implement the method in .cpp file and then invoke it in another file assume main. I receive the error saying
'array': undeclared identifier
type 'int' expected
Please suggest what could be wrong. Please note this works perfect if I declare the function in the same file from where I am invoking it