home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!uunet.ca!wildcan!sq!msb
- From: msb@sq.sq.com (Mark Brader)
- Subject: Re: A different C puzzle
- Message-ID: <1992Dec23.092712.2408@sq.sq.com>
- Summary: impossible
- Organization: SoftQuad Inc., Toronto, Canada
- References: <768@ulogic.UUCP>
- Date: Wed, 23 Dec 92 09:27:12 GMT
- Lines: 18
-
- > > Write a [C] program that uses every valid character exactly once.
- > I should think it would be rather difficult to use only one " ...
-
- You could manage that with a #define or a character constant, but each
- of those also involves a repeated character (e or ') and so is ruled
- out. I think it's clear that the problem has no solution that is a
- strictly conforming ANSI C program. You must have a "main()", and that
- already means that (a) you can't call any other functions (parentheses);
- and (b) you can't have a return statement (two r's). So you can't
- terminate in a permissible way. I note in addition that every
- preprocessor directive either has a letter in common with "main"
- or has a repeated letter; thus no preprocessor tricks could be used.
- --
- Mark Brader "Howeb45 9 qad no5 und8ly diturvrd v7 7jis dince
- SoftQuad Inc., Toronto 9 qas 8mtillihemt mot ikkfavpur4d 5esoyrdeful
- utzoo!sq!msb, msb@sq.com abd fill if condif3nce on myd3lf." -- Cica
-
- This article is in the public domain.
-