Well to signal an EOF condition in your terminal, you should press ctrl-z (if you're on windows), or ctrl-d (Linux or other BSD/Unix like operating systems).
Also, never use gets()
FAQ > Why gets() is bad / Buffer Overflows - Cprogramming.com
Well to signal an EOF condition in your terminal, you should press ctrl-z (if you're on windows), or ctrl-d (Linux or other BSD/Unix like operating systems).
Also, never use gets()
FAQ > Why gets() is bad / Buffer Overflows - Cprogramming.com
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.