Bizarre question! Here's the results for my check50 on my initials-more problem:
https://cs50.me/checks/815aa9b0c96b6d2a3df539987aa9d8829c5200af
It shows that my output returns "HJ" as it should do - and when I enter the same name into my problem I get the correct output, rather than what the terminal says during the checking process ("HJ\x00\n").
I'm happy to share the entirety of my code so it can be checked just in case I've screwed up somewhere, but on the one hand it says my code is correct and then not correct. I'm so confused!
I don't want to upload it and receive a lower score than I should do, if the solution is correct. I'd love to hear your thoughts :)
int main(void)
{
// ask user for input
string name = get_string();
// ensure that get_string returned a string
if (name != NULL)
{
// print first character, if it's not a space
if (name[0] != ' ')
{
printf("%c", toupper(name[0]));
}
// iterate over the characters in name one at a time
for (int i = 0, n = strlen(name); i < n; i++)
{
//print initials after an indetermined number of spaces
if (name[i] == ' ' && name[i+1] != ' ')
printf("%c", toupper(name[i+1]));
}
// print final space at the end of the initials
printf("\n");
}
}