-2

My prototype for the function

int ConvertUserColorToInteger(char [][7] , char [] );

int main (void)
{

This is my definition of the Function

      char COLOR_CODES[10][7] = {"black", "brown", "red", "orange", "yellow",   "green", "blue", "violet", "gray", "white"};
       char userColor1[10];
       char userColor2[10];
       char userColor3[10];

This is my invocation for my function and this is also the thing i am having errors with

     ConvertUserColorToInteger(COLOR_CODES[][7], userColor[]);
Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

2

You are calling the function in wrong way. In your case, you should write

 ConvertUserColorToInteger(COLOR_CODES, userColor1);

instead of

 ConvertUserColorToInteger(COLOR_CODES[][7], userColor[]);

as you need to pass a pointer to the array of type char[7] and char, respectively, while making the call.

Sourav Ghosh
  • 133,132
  • 16
  • 183
  • 261