Finding unique elements in an string array in C

后端 未结 5 2159
轻奢々
轻奢々 2021-01-05 16:39

C bothers me with its handling of strings. I have a pseudocode like this in my mind:

char *data[20]; 

char *tmp; int i,j;

for(i=0;i<20;i++) {
  tmp = da         


        
5条回答
  •  臣服心动
    2021-01-05 16:44

    Might it be that your test is if (strcmp (this, that)) which will succeed if the two are different? !strcmp is probably what you want there.

提交回复
热议问题