Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: printf() an...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 44 Topic 24817 of 28006
Post > Topic >>

Re: printf() and scanf() questions

by Andrey Tarasevich <andreytarasevich@[EMAIL PROTECTED] > Mar 5, 2008 at 01:33 PM

Walter Roberson wrote:
>>
>> 1. scanf() provides the "%f" specifier for float. How can it discern 
>> when we pass a double?
> 
> %f indicates floating point in general, not the type 'float'.
> If you are supplying a pointer to a float, you use "%hf".
> If you are supplying a pointer to a double, you use "%f".
> If you are supplying a pointer to a long double, you use "%Lf".

I haven't checked the very-very latest changes in the standard, but I 
don't believe they can be that drastic. In the original edition of C99

- 'h' cannot be used in '%f'
- '%f' takes a 'float*' argument, '%lf' takes a 'double*' argument

-- 
Best regards,
Andrey Tarasevich
 




 44 Posts in Topic:
printf() and scanf() questions
Ioannis Vranos <ivrano  2008-03-05 22:10:26 
Re: printf() and scanf() questions
roberson@[EMAIL PROTECTED  2008-03-05 20:20:35 
Re: printf() and scanf() questions
Andrey Tarasevich <and  2008-03-05 13:33:01 
Re: printf() and scanf() questions
Micah Cowan <micah@[EM  2008-03-05 21:35:06 
Re: printf() and scanf() questions
Ioannis Vranos <ivrano  2008-03-06 00:25:56 
Re: printf() and scanf() questions
Micah Cowan <micah@[EM  2008-03-05 22:34:25 
Re: printf() and scanf() questions
Ioannis Vranos <ivrano  2008-03-06 00:22:34 
Re: printf() and scanf() questions
Ioannis Vranos <ivrano  2008-03-06 00:22:59 
Re: printf() and scanf() questions
Micah Cowan <micah@[EM  2008-03-05 22:40:08 
Re: printf() and scanf() questions
Martin Ambuhl <mambuhl  2008-03-05 19:22:04 
Re: printf() and scanf() questions
Mark McIntyre <markmci  2008-03-06 00:38:44 
Re: printf() and scanf() questions
Ioannis Vranos <ivrano  2008-03-06 02:49:38 
Re: printf() and scanf() questions
Ioannis Vranos <ivrano  2008-03-06 02:50:10 
Re: printf() and scanf() questions
Martin Ambuhl <mambuhl  2008-03-05 19:58:15 
Re: printf() and scanf() questions
Mark McIntyre <markmci  2008-03-06 21:44:02 
Re: printf() and scanf() questions
Martin Ambuhl <mambuhl  2008-03-06 17:41:58 
Re: printf() and scanf() questions
gazelle@[EMAIL PROTECTED]  2008-03-06 22:45:19 
Re: printf() and scanf() questions
Martin Ambuhl <mambuhl  2008-03-05 19:57:00 
Re: printf() and scanf() questions
Mark McIntyre <markmci  2008-03-06 21:45:54 
Re: printf() and scanf() questions
Antoninus Twink <nospa  2008-03-06 23:22:43 
Re: printf() and scanf() questions
gazelle@[EMAIL PROTECTED]  2008-03-06 22:44:33 
Re: printf() and scanf() questions
Martin Ambuhl <mambuhl  2008-03-06 17:44:18 
Re: printf() and scanf() questions
gazelle@[EMAIL PROTECTED]  2008-03-06 22:46:27 
Re: printf() and scanf() questions
Antoninus Twink <nospa  2008-03-07 00:09:19 
Re: printf() and scanf() questions
gazelle@[EMAIL PROTECTED]  2008-03-06 23:59:48 
Re: printf() and scanf() questions
jacob navia <jacob@[EM  2008-03-07 00:59:22 
Re: printf() and scanf() questions
Martin Ambuhl <mambuhl  2008-03-06 19:07:40 
Re: printf() and scanf() questions
gazelle@[EMAIL PROTECTED]  2008-03-07 01:45:00 
Re: printf() and scanf() questions
Mark McIntyre <markmci  2008-03-07 23:37:08 
Re: printf() and scanf() questions
Antoninus Twink <nospa  2008-03-08 00:42:29 
Re: printf() and scanf() questions
gazelle@[EMAIL PROTECTED]  2008-03-08 00:08:05 
Re: printf() and scanf() questions
Mark McIntyre <markmci  2008-03-06 21:48:54 
Re: printf() and scanf() questions
Antoninus Twink <nospa  2008-03-06 23:23:29 
Re: printf() and scanf() questions
gazelle@[EMAIL PROTECTED]  2008-03-06 22:42:17 
Re: printf() and scanf() questions
Martin Ambuhl <mambuhl  2008-03-05 15:50:02 
Re: printf() and scanf() questions
richard@[EMAIL PROTECTED]  2008-03-05 21:17:57 
Re: printf() and scanf() questions
Andrey Tarasevich <and  2008-03-05 13:21:18 
Re: printf() and scanf() questions
Richard <devr_@[EMAIL   2008-03-06 02:06:39 
Re: printf() and scanf() questions
CBFalconer <cbfalconer  2008-03-05 20:21:17 
Re: printf() and scanf() questions
Richard <devr_@[EMAIL   2008-03-06 23:55:12 
Re: printf() and scanf() questions
Richard <devr_@[EMAIL   2008-03-06 23:56:49 
Re: printf() and scanf() questions
gazelle@[EMAIL PROTECTED]  2008-03-07 00:03:38 
Re: printf() and scanf() questions
Richard <devr_@[EMAIL   2008-03-07 03:40:10 
Re: printf() and scanf() questions
Richard <devr_@[EMAIL   2008-03-08 19:45:34 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 12:20:26 CST 2008.