I get stuck in an infinite loop. How can I terminate this loop? I tried to use/press Cntrlc but nothing happens. I don't know how to stop it.
main()
{
while (1)
{
char ch;
printf("Enter a character: \n");
ch = getche();
printf("\nThe code for %c is %d.\n", ch, ch);
}
}
CTRLBREAK will probably work for this. I have a vague recollection that CTRLC did not always work with the Borland products.
Though, that was a long time ago so I had to retrieve that from very deep memory, which may have faded somewhat :-)
My question for you is: Why is anyone still using Turbo C when much better and equally cheap solutions are available? Like gcc (such as in Code::Blocks) or even Microsoft Visual C Express.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With