On Thu, 2 Dec 2010, Richard wrote:
for (;;)
;
I don't see how this is an infinite loop requiring reset of the
processor to escape since the condition clause is empty. In fact,
since the condition clause is empty, I'm not even sure its
syntactically valid, but C is strange enough that it may be
syntactically valid but not intuititve.
Yes, C DOES permit an empty condition clause. Valid, and often used when
a programmer prefers to use the "for" rather than "while" keyword.
C permits, and damn near ENCOURAGES, "puzzle code"
A sparse commenting style that one might get away with in many other
languages, can be a disaster in C. Consider
while (*t++=*s++);
Or, read any of Holub's work to see great examples of short statements in
C that require a lot of thought to figure out.
But, I thought that APL was a lot of fun.
--
Grumpy Ol' Fred cisin at
xenosoft.com