Write a function max that has two C string parameters and returns the larger of the two.

LANGUAGE: C++

CHALLENGE:

Write a function max that has two C string parameters and returns the larger of the two.

SOLUTION:

char* max(char *a, char *b)
{
    int result = strcmp(a, b);
    if (result > 0)
        return a;
    else
        return b;
}