home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!trirex!root
- From: dharris@trirex.com (Doug Harris)
- Subject: Variable field width portable? (was question about \t)
- Message-ID: <1992Aug17.160134.7299@Trirex.COM>
- Sender: root@Trirex.COM (Operator)
- Reply-To: dharris@trirex.com
- Organization: Trirex Systems Inc.
- Date: Mon, 17 Aug 1992 16:01:34 GMT
- Lines: 18
-
- Jutta Degener writes
- >To print a string indented by n spaces:
- >
- > printf("%*s%s\n", n, "", string);
- >
-
- Is this portable? I'd never seen this before and it's not in the ANSI
- C book that I have (_The Waite Group's Essential Guide to ANSI C_), but
- it compiles and runs as advertised under NeXT's GNU C compiler...
-
- curious,
- doug
-
- --
- | Doug Harris |
- | Trirex Systems Inc. |
- | dharris@trirex.com (NeXTMail) |
- | dough@panix.com |
-