santosh said:
Why make your program needlessly non-portable,
especially given that clearing the screen is not important to most
console programs?
C isn't only useful for console programs, and clearing a screen (or, more
commonly nowadays, a window) can be a useful thing to do. It is not
unreasonable to ask whether an ISO C method exists (although of course we
know the answer is that it doesn't, and that an implementation-specific
method will need to be used).
Yes, you're right that a great many people seem to delight in clearing the
screen for no particularly good reason. But the OP *might* have a good
reason for asking - you never know your luck! - so the best thing to do, I
suppose, is simply to explain the fact that the method will vary from
system to system, so he should abstract out the non-portable functionality
into a separate function, and then write various versions of that function
on an implementation-by-implementation basis.