This is supposed to return the index of the first empty string in the array using recursion. Instead of returning the index of the FIRST empty string, this function I wrote returns the index of the LAST empty string. I have no idea how to search from the beginning of the array.
int firstEmpty(const string a[], int n)
{
if (a[n-1].empty())
return n-1;
if (n > 0)
{
return firstEmpty(a, n-1);
}
return -1;
}