Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx01.iad01.newshosting.com!newshosting.com!69.16.185.11.MISMATCH!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!panix!not-for-mail |
|---|---|
| From | jgk@panix.com (Joe keane) |
| Newsgroups | comp.lang.c, comp.std.c |
| Subject | Re: Customizing printf |
| Date | Mon, 21 Nov 2011 22:50:32 +0000 (UTC) |
| Organization | Public Access Networks Corp. |
| Lines | 31 |
| Message-ID | <jaekjo$rmo$1@reader1.panix.com> (permalink) |
| References | <j9tps6$nc9$1@speranza.aioe.org> <87vcql1cl1.fsf@blp.benpfaff.org> <jab5gl$b6p$1@reader1.panix.com> <98791897-ac7d-4e5a-a528-7c2d543e1ed8@x7g2000yqb.googlegroups.com> |
| NNTP-Posting-Host | panix5.panix.com |
| X-Trace | reader1.panix.com 1321915832 28376 166.84.1.5 (21 Nov 2011 22:50:32 GMT) |
| X-Complaints-To | abuse@panix.com |
| NNTP-Posting-Date | Mon, 21 Nov 2011 22:50:32 +0000 (UTC) |
| X-Newsreader | trn 4.0-test76 (Apr 2, 2001) |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.c:13750 comp.std.c:911 |
Cross-posted to 2 groups.
Show key headers only | View raw
In article <98791897-ac7d-4e5a-a528-7c2d543e1ed8@x7g2000yqb.googlegroups.com>,
Nick Keighley <nick_keighley_nospam@hotmail.com> wrote:
>how many parameters do fputint() and fputdouble() have?
int fputint(FILE *fp, int val, int wid, int opt);
int fputdouble(FILE *fp, double val, int wid, int dp, int opt);
[C++]
>try printing a four digit hexadecimal number. Or a double with 3
>significant digits. You can do thse things but they're awkward,
When i first saw this wacky crap, i thought 'is this a joke?' and then
'is this someone's idea of good design?'.
But note that all the problems come from assuming that the input/output
functions have two arguments, which is just wrong. For example, i
rarely see a 'double' printed with a bare "%f"; the format is as
important as the value.
And if you write 'fputint' and someone says 'that's decimal! i need
octal!' you say, well here you go:
int fputdecint(...);
int fputoctint(...);
int fputhexint(...);
Or just use the 'opt' thingy i gave above.
The problem is that all the functions are called "<<"; so you have the
type to split on, but that's really not sufficient.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Customizing printf jacob navia <jacob@spamsink.net> - 2011-11-15 14:36 +0100
Re: Customizing printf "Joel C. Salomon" <joelcsalomon@gmail.com> - 2011-11-15 13:07 -0500
Re: Customizing printf Ben Pfaff <blp@cs.stanford.edu> - 2011-11-15 10:10 -0800
Re: Customizing printf jacob navia <jacob@spamsink.net> - 2011-11-15 21:36 +0100
Re: Customizing printf blp@cs.stanford.edu (Ben Pfaff) - 2011-11-15 12:51 -0800
Re: Customizing printf "Joel C. Salomon" <joelcsalomon@gmail.com> - 2011-11-15 18:03 -0500
Re: Customizing printf jgk@panix.com (Joe keane) - 2011-11-20 15:14 +0000
Re: Customizing printf blp@cs.stanford.edu (Ben Pfaff) - 2011-11-20 10:43 -0800
Re: Customizing printf Lauri Alanko <la@iki.fi> - 2011-11-20 19:01 +0000
Re: Customizing printf blp@cs.stanford.edu (Ben Pfaff) - 2011-11-20 11:05 -0800
Re: Customizing printf Dag-Erling Smørgrav <des@des.no> - 2011-11-20 20:38 +0100
Re: Customizing printf blp@cs.stanford.edu (Ben Pfaff) - 2011-11-20 11:37 -0800
Re: Customizing printf jgk@panix.com (Joe keane) - 2011-11-21 22:23 +0000
Re: Customizing printf Ian Collins <ian-news@hotmail.com> - 2011-11-22 11:26 +1300
Re: Customizing printf blp@cs.stanford.edu (Ben Pfaff) - 2011-11-21 14:23 -0800
Re: Customizing printf Kaz Kylheku <kaz@kylheku.com> - 2011-11-21 23:06 +0000
Re: Customizing printf jgk@panix.com (Joe keane) - 2011-11-23 00:09 +0000
Re: Customizing printf blp@cs.stanford.edu (Ben Pfaff) - 2011-11-22 16:16 -0800
Re: Customizing printf Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-21 05:29 -0800
Re: Customizing printf jgk@panix.com (Joe keane) - 2011-11-21 22:50 +0000
Re: Customizing printf Lowell Gilbert <lgusenet@be-well.ilk.org> - 2011-11-15 13:13 -0500
Re: Customizing printf "-.-" <none@none.none> - 2011-11-16 14:06 +0100
Re: Customizing printf gazelle@shell.xmission.com (Kenny McCormack) - 2011-11-16 13:40 +0000
Re: Customizing printf Seebs <usenet-nospam@seebs.net> - 2011-11-16 20:18 +0000
Re: Customizing printf Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-11-17 07:54 +0200
csiph-web