i have loaded the string data from file to double array.this is example:
const_array[1][]=a1,b1,c3,
const_array[2][]=a2,b1,c3,
const_array[3][]=a3,b2,c2,
const_array[4][]=a2,b3,c1,
const_array[5][]=a3,b2,c1,
those data need to be compared to this string:
append_test_data.this is also an array and it will be changed randomly by d program.the prob is,my prog just compare to the last data in array,const_array[5][]=a3,b2,c1,
i use this code to compare.
for(int n=1;n<=m;n++)
{
if(strcmp(append_test_data,const_array[n]) == 0)
{
printf("Append data is =%s\n",append_test_data);
printf("constraint is found=%s\n",const_array[n]);
getch();
exit(0);
}
}
my question is,how is strcmp works?is it compare to the lenght of the string or the string itself?why dose it compare to the last data in array?