I am making a morse code where when we enter a word or number or sentence etc, it gets turned into morse but I can't exit my do while loop.
printf("Enter anything you want to be translated to morse, if you want to listen to what exit sounds like and exit the program, type 'Exit'\n");
do {
fgets(Morse, sizeof Morse, stdin);
for (int z = 0, length = strlen(Morse); z < length; z++) {
int n = 0;
n++;
}
for (int i = 0, length = strlen(Morse); i < length; i++)
switch (Morse[i]) {
up line ends where my switch cases come in, in which I check which character it is and at the end of my do while loop, it ends like :
}
}while(strcmp(Morse, "Exit") != 0);
return 0;
but even when I type exit, it doesn't exit. What should I do?