[quote name='Euniceno1' date='24 Oct, 2006 - 06:40 PM' post='178938']
The following are the code That I created:
CODE
#include <stdio.h>
#include <ctype.h>
int main(void)
{
int c, i, j, letter[26][26];
for (i=0; i<26; ++i) /* init array to zero */
for( j= 0; j<26; ++j)
while((c = getchar()) != EOF) /* count the letter */
if(isupper© && islower©)
for (i=0; i<26; ++i)
if(i%6==0)
for ( j= 0; j<26; ++j)
if(j%6==0) {
printf("\n");
printf("%4c%4c:%3d%3d", 'A' || 'a' +i +j, letter[i][j]);
}
printf("\n\n");
return 0;
}
and the error I got from the gcc compiler:
letter1.c:In function 'main':
letter1.c:9:error: incompatible types in assignment
letter1.c:11:error: incompatible types in assignment
letter1.c:14:error: parse error before 'A'
letter1.c:14:error: parse error before 'A'
I don't know how to correct it.
edit: added
CODE
tags ~ jayman9
[/quote]
Euniceno
The compiler gave you line numbers....
[code]
File which function
letter1.c : In function 'main':
the problem description.....
letter1.c:9:error: incompatible types in assignment
^ line number...
Lets get those lines down here...
CODE
# Line
9 letter[i] = 0;
11 letter[j] = 0;
14 ++letter[c -> 'A' && c -> 'a'];
Now we can see a trend in the code.. Dragonlady has hit the nail on the head.
Letter[i] simply doesn't match the definition letter[][].