Re: printf *%f

Aniruddha Bhattacharyya <[email protected]> Wed, 12 Jan 2011 15:23:44 +0530
Newsgroups org.kernel.vger.linux-c-programming
Message-ID <[email protected]>
Use "%.*f" for Float    (its ".*" not "*")
and "%*d" for int

On Wed, Jan 12, 2011 at 3:22 PM, Aniruddha Bhattacharyya
<[email protected]> 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 <[email protected]> wrote:
>>
>> On Wed, Jan 12, 2011 at 2:32 PM, Bert Wesarg <[email protected]> wrote:
>> > On Wed, Jan 12, 2011 at 09:59, Fei Zhao <[email protected]> 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 [email protected]
>> > 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 [email protected]
>> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html