The problem is using your const int NUM_ELEMS as the name of your function parameter. Call it something else, or better yet don't pass it at all as it's global.