I'm writing a c++ script that compare chars of two strings one by one using strcmp(). I wrote this code:
char test1[1];
char test2[1];
test1[0]=str1[i]; //str1 is a char array
test2[0]=str2[i]; //str2 is a char array
int result=strcmp(test1,test2);
but if I print test1 or test2 I encountered with two chars. for example if first index of str1='a' then test1 is "aa" but I don't know why? Please Help.