I'm stuck on this little code, does anyone know what's wrong?
#define COUNTOF(x) \
( sizeof(x) / sizeof((x)[0]) )
char *afalbeto[] = {
"CHAR",
"CHARS",
"COMMON"};
char *afalbeto2[] = {
"CHAR2",
"CHARS2",
"COMMON2"};
.....
void findit(char *alf1[], char *alf2[]){
int i1t = COUNTOF(alf1);
int i2t = COUNTOF(alf2);
for (int i1 = 0;i1 < i1t;i1++) {
...
}
/*same loop for alf2*/
}
main..{
..
findit(afalbeto, afalbeto2);
findit(afalbeto2, afalbeto);
..
}
It only prints 1 code or sometimes crash :(