I have to 2 constant arrays in header files, say
const TPair<char, char> array1[] =
{
{'V', rV},
{'v', rv},
{'H', rH},
{'h', rg},
{0, 0}
};
and array2 similar to array1.
Now I need a function that will choose one of these arrays and return pointer to appropriate array.
How should signature of this function look like? And what do I return: array1 or array1&?
typedefs make this kind of code much more readable:Then, …
Your choosing function may look a bit like this: