
Matthew B. answered 06/20/17
Tutor
5
(8)
Experienced Tutor Specializing in Computer Science
Hello Sathya,
There are slightly different ways to do this in C++ they all boil down to the same two things passing the information(the array) and the size of the array. One method (probably the most typical you'll see) passing a pointer to the array as well as an integer of the size of the array. Another common method is to pass the array and the size of the array. The functions Foo and Foo1 show this in this order.
void Foo(int *arrayVar, int size) {...}
void Foo1(int arrayVar[], int size) {...}
int main() {
int someArray[3] = {1,2,3};
Foo(someArray, 3);
Foo1(someArray, 3);
return 0;
}

Keith B.
06/29/17