i made my own function to search if two given strins in my function are equal but the problem is if i pass two variable like hello,hello
result is string equal but if i pass hello , gello also give me string equal because last 4 characters same to last 4 characters of hello how i can solve this problem thanks very much
Code:int getSimilarityOfTwoStrings(const char str1[],const char str2[]){ int str1Len = getStringLength(str1); int str2Len = getStringLength(str2); int i = 0; int j = 0; bool truefalse; if(str1Len > str2Len || str2Len > str1Len || str1Len < str2Len || str2Len < str1Len){ truefalse = false; exit(EXIT_FAILURE); }else{ for(i = 0; i < str1Len; i++){ if(tolower(str1[i]) == tolower(str2[j++])){ truefalse = true; }else{ truefalse = false; } } } return truefalse; }