int i;
for(i = 0; used[i] != '\0' && used[i] != input; i++); //<- must have semicolon here.
//The above for loop loops until either it hits the end of data or used character
if(used[i] == '\0') // If this is true, input is a new character
{
used[i] = input; // stores latest input
used[i+1] = '\0' // ensures that the next element is the string terminator
return input; // returns the character so you can use it in the checkchar function
}
else
{
return '\0'; // returns 0 so that you can use if(usedcharacters(...) == '\0') to check state
}
}