I have array of pointers in liste_tmp with values "123" , "456" , "123"
Declaration :
char *no_rlt_liste[5] , *liste_tmp[5]; int i, j, count =0;
for (i = 0 ; i < n; i++){
for ( j= 0 ; j< count; j++){
if (liste_tmp[i] == no_rlt_liste[j]){
break;
}
if (j == count){
no_rlt_liste[count] = liste_tmp[i];
printf(" ENTER\n");
count++;
}
}
}
for (i = 0 ; i < count; i++)
printf("Final result %s\n", no_rlt_liste[i]);
the above code doesn't produce result. not able to identify the bug. any help? Thanks
strcmp()? And I assume you clipped out the code where you actually properly initializeliste_tmp[]andno_rlt_liste[]?ninfor (i = 0 ; i < n; i++)?strcmp()to compare strings, probably in place ofif (liste_tmp[i] == no_rlt_liste[j]).