invalid conversion from 'char' to 'int* in C

Posted by majdal on Stack Overflow See other posts from Stack Overflow or by majdal
Published on 2010-05-22T20:54:35Z Indexed on 2010/05/22 21:00 UTC
Read the original article Hit count: 256

Filed under:
|

Hi,

I have the following arrays:

int A[] = {0,1,1,1,1, 1,0,1,0,0, 0,1,1,1,1};
int B[] = {1,1,1,1,1, 1,0,1,0,1, 0,1,0,1,0};
int C[] = {0,1,1,1,0, 1,0,0,0,1, 1,0,0,0,1};
//etc... for all letters of the alphabet 

And a function that prints the letters on a 5x3 LED matrix:

void printLetter(int letter[])

I have a string of letters:

char word[] = "STACKOVERFLOW";

and I want to pass each character of the string to the printLetter function.

I tried:

int n = sizeof(word);

for (int i = 0; i < n-1; i++) {  
    printLetter(word[i]);
}

But I get the following error: invalid conversion from 'char' to 'int*'

What should i be doing?

Thanks!!

© Stack Overflow or respective owner

Related posts about c

    Related posts about arduino