Stuck on a program i've been trying to work on for the last few hours.
A user enters 2 arrays, both are charater arrays with 5 spaces each.
They are passed into a function that compares the 2 arrays to each other character by character. If they are idenital the user is informed of this.
void comp(char string1[], char string2[])
{
int i;
for(i = 0; i < 5; i++)
{
if(string1[i] == string2[i])
{
printf("they are the same.\n");
}
else
{
printf("they are not the same.\n");
}
}
}
This is what i have so far but from my googling it seems like you can't use "==" operators to compare to character array spaces.
Anyways around this or am i missing something obvious?