#include <string.h>
// strcmp is a function from the stadard string library that returns 0 of both strings are equals
int main () {
// for exemple
char[] str1 = "Hey!";
char[] str2 = "Hey!";
char[] str3 = "Hola";
// instead of "if (str1 == srt2)" you'll need to use
if (strcmp(str1, str2) == 0)
printf("str1 = str2
");
if (strcmp(str1, str3) != 0)
printf("str1 != str2
");
return 0;
}
int strEqu(char *a, char *b)
{
int i = 0;
while (1)
{
if (*(a + i) == 0 && *(b + i) == 0) return 1;
else if (*(a + i) != *(b + i)) return 0;
i++;
}
}