vendredi 27 mars 2015

Compare arrays of words in C



How I can compare 2d arrays of char in C? I tried this



Char **arr_1;
Char **arr_2;

...// malloc. Its OK.

for (I=0; I<n; I++)
{
If (strcmp (arr_1[I],arr_2[I])==0)
// do smth
}


But it doesn't work . I'm not good in pointers.


Arrays have some array of words.


Thanks




Aucun commentaire:

Enregistrer un commentaire