Array indexing vs. pointers...
Jim Walsh
jimw at microsoft.UUCP
Wed Oct 12 12:40:31 AEST 1988
In article <171 at umigw.MIAMI.EDU> steve at umigw.miami.edu (steve emmerson) writes:
>Nonsense. Use instead:
>#define EPUTS(msg) (void)fputs(msg, stderr)
> EPUTS("Usage: sltread [options] input-drive-name\n");
> EPUTS("Options: [-l] [-s] [-v] [-x] [-z] [-t tape-volume-number]\n");
> EPUTS(" [-d dataset-name] [-n dataset-number]\n");
> EPUTS(" [-i ignore-count] [-r record-count]\n");
>
>This has all the advantages -- and none of the disadvantages -- of the other.
>In ANSII-C you could even have the macro append the newline.
I believe that ANSI C allows (at least the implementation I'm using does
without flagging it in the manual as a deviation)
fputs("Usage: sltread [options] input-drive-name\n"
"Options: [-l] [-s] [-v] [-x] [-z] [-t tape-volume-number]\n"
" [-d dataset-name] [-n dataset-number]\n"
" [-i ignore-count] [-r record-count]\n", stderr);
Thus you truly get ALL the advantages - a single function call, and even a few
null bytes saved.
--
Jim Walsh jimw at microsof.beaver.cs.washington.EDU
Microsoft Corporation jimw at microsof@uw-beaver.ARPA
jimw at microsof.UUCP
The views expressed herein are not necessarily mine, let alone Microsoft's...
More information about the Comp.lang.c
mailing list