My question is related to my previous post:
explicit specialization: syntax error?
I am trying to pass arrays of pointer-to-chars as an argument to a function (which I will later incorporate to a specialized function from previous post), but I cannot get the syntax right.
The following were declared under main program:
char c0[30] = { "see if this works" };
char c1[30] = { "functions" };
char c2[30] = { "explicit specialization" };
char *d[] = { c0, c1, c2 };
the next line prints "functions " as I was expecting:
cout << "test print d[1] " << d[1] << endl;
The next step is to test whether I am able to return the character-array that I want to return, but my syntax is incorrect. The following returns 's' (from c0) instead of an entire char-array:
function call:
cout << "string compare is " << compare2(*d, 3);
function declaration:
char compare2(char const arr2[], int n) {
char temp;
temp = arr2[0];
return temp;
appreciate the help!