Assuming that you want to call the function with data that look like that:
char* aa[] = { "AA", "BB", "CC", "DD" };
GetCodes(aa);
And you want N to be automatically determined by the compiler, then you need to have a reference in the declaration and fix the parenthesis.
template<size_t N>
inline int GetCodes( char *(&codes)[N] ){ return GetCodes( codes, N ); };
The reference is required to avoid the automatic convertion from array to pointers that would otherwise occurs.
As an example:
template <typename T>
void Test1(T t)
{
std::cout << "Test 1: " << typeid(t).name() << std::endl;
}
template <typename T>
void Test2(T &t)
{
std::cout << "Test 2: " << typeid(t).name() << std::endl;
}
int main()
{
int data[] = { 1, 2, 3, 4 };
Test1(data);
Test2(data);
return 0;
}
This will give the following input:
Test 1: int *
Test 2: int [4]