From: Aniruddha Bhattacharyya <aniruddha.aot@gmail.com>
To: ratheesh k <ratheesh.ksz@gmail.com>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: printf *%f
Date: Wed, 12 Jan 2011 15:23:44 +0530 [thread overview]
Message-ID: <AANLkTimUhpC0VfX-C+u_NA7==bZ_Ecv19+rrMOK8bG5q@mail.gmail.com> (raw)
In-Reply-To: <AANLkTinioDUcJ-1huPHJ3XoSkm63S14j5LzWOiQp7gmS@mail.gmail.com>
Use "%.*f" for Float (its ".*" not "*")
and "%*d" for int
On Wed, Jan 12, 2011 at 3:22 PM, Aniruddha Bhattacharyya
<aniruddha.aot@gmail.com> wrote:
>
>
> Use "%.*f" for Float (its ".*" not "*")
> and "%*d" for int
>
> Ref: http://www.cplusplus.com/reference/clibrary/cstdio/printf/
>
> On Wed, Jan 12, 2011 at 2:44 PM, ratheesh k <ratheesh.ksz@gmail.com> wrote:
>>
>> On Wed, Jan 12, 2011 at 2:32 PM, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
>> > On Wed, Jan 12, 2011 at 09:59, Fei Zhao <skywalkzf@gmail.com> wrote:
>> >> I mean's that when to use printf("%*.*f" , 4, 2 , x) ; in linux kernel or
>> >> our practical use?
>>
>> If you want to control the format dynamically.
>> scanf("%d" , &first);
>> scanf("%d" , %second);
>> printf("%*.*f", first ,second , x);
>>
>> > I don't know when you want to use such calls, how should I? And what
>> > has the linux kernel to do with this, this doesn't came up before, and
>> > what is '*our* practical use'?
>> >
>> > Bert
>> > --
>> > To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
>> > the body of a message to majordomo@vger.kernel.org
>> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>> >
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-01-12 9:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-12 7:39 printf *%f ratheesh k
2011-01-12 7:46 ` Bert Wesarg
[not found] ` <AANLkTi=f-TrLVC-S9PpY-HcLKgujNOtii7bG-U5tSPyy@mail.gmail.com>
2011-01-12 8:51 ` Bert Wesarg
[not found] ` <AANLkTin=9aSsQTUh8MXOsgpwPC8hotwXjk=XOFjHwiRa@mail.gmail.com>
2011-01-12 9:02 ` Bert Wesarg
2011-01-12 9:14 ` ratheesh k
[not found] ` <AANLkTinioDUcJ-1huPHJ3XoSkm63S14j5LzWOiQp7gmS@mail.gmail.com>
2011-01-12 9:53 ` Aniruddha Bhattacharyya [this message]
2011-01-12 9:54 ` Aniruddha Bhattacharyya
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTimUhpC0VfX-C+u_NA7==bZ_Ecv19+rrMOK8bG5q@mail.gmail.com' \
--to=aniruddha.aot@gmail.com \
--cc=linux-c-programming@vger.kernel.org \
--cc=ratheesh.ksz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).