First of all, it's *very* dangerous to get in the habbit of assuming
things about the lengths of raw C++ arrays. C++ does *not* check bounds
on raw arrays. If one (or both) of the two arrays passed into that
function happened to be smaller than NumElement, then you're looking at
undefined behaviour. Typically, you'll read (or write) past the end of
the array and get data corruption, crashes and/or points where a clever
hacker could inject arbitrary binary code into your program. So if you
must deal with raw arrays, ALWAYS pass the sizes around with them and
verify that every read or write is in bounds.
Whenever possible, try to use std::vector, std::array, and other
standard container classes that automatically check array bounds. (If
your instructor told you to use raw arrays for this assignment, please
tell him/her that comp.lang.c++ disapproves of your curriculum :)
Second of all, no, that syntax isn't correct. What error messages does
your compiler give you? They should point you in the right direction.
As for returning the array, look up "pass by value" and "pass by
reference".
Rennie