I ran into this problem while coding today.
<<<<<<<<<<<<<<<<<<<Start of Code>>>>>>>>>>>>>>>>>
//Test1
char test[] = "naBac a";
str_compare="nABAc A";
compare_strings(test,str_compare);
//Test2
test = "aaa";
str_compare = "AAA";
compare_strings(test,str_compare);
<<<<<<<<<<<<<<End of Code>>>>>>>>>>>>>>>>>>>
I got some errors, basically I had to clear out the char array before reassigning and proceeding with 2nd test case.
I tried 2 ways to do the same
1) test[]="";
2) test[0]={0};
Neither of them worked.
This brought me to the interesting question, how to clear a character array, to reassign it and use.