Let's say that he has presented an ANSI C program, but with a terminal
getch().
We all know that Windows compilers tend to run things in temporary shells
that disappear on progream termination, and that this is a fix.
No we don't. Well, we do now but I didn't before I read this. I use
Windows compilers more often than I like, but I've never run a program
from one.
We should
also point out that it renders the program non-portable and is the wrong
answer to the problem.
What we shouldn't do is pretend never to have heard of the getch() function.
This is a techncially correct position which amuses some regulars, but it
irritates others. It is alright from the inside, but it can intimidate
newcomers.
Your point is entirely valid though. I've seen getch() on the end of
some example programs, and made a reasonable guess at what it does
while being puzzled about why it should be done at that point.
However, the poster's problem is often very clear, and unrelated to
any non-Standard or omitted parts of the example. If there's a non-
Standard unsupplied header included, we can't be absolutely certain of
what's going on because we don't know what horrors are hiding in the
header; but in the vast majority of such cases the unknown bits are
not related to the problem. It might be appropriate to say something
like "these bits are non-Standard C, and including them in the example
code might have effects that we don't know about, but it looks very
likely that the problem is 'x'. If that doesn't sort it out, try to
come up with an example of the problem which doesn't include any non-
Standard stuff and post again".
When you can see with near certainty that the problem is a missing
semicolon, or a mis-spelled variable name, it is puerile to send the
poster away because there's a getch() at the end of the code or an
unused inclusion of <conio.h>.