typecasting-"ek chota sa doubt story!!!"
2 posters
Page 1 of 1
typecasting-"ek chota sa doubt story!!!"
y do we put f after a floating no in c...
like
float no=2.3f;
printf("%f",no);
even if we don put f it works fine...and we get the same output in both the cases..
like
float no=2.3f;
printf("%f",no);
even if we don put f it works fine...and we get the same output in both the cases..
$corpion- Posts : 25
Join date : 2009-01-30
Age : 37
Re: typecasting-"ek chota sa doubt story!!!"
as far as i know:
the float numbers are actually Double by default.so ,u specifically use F or f to point out its an float.
on the other hand they still work without F or f,due to implicit type conversion from double to float.
if u note, even int and char have such a relationship.
the float numbers are actually Double by default.so ,u specifically use F or f to point out its an float.
on the other hand they still work without F or f,due to implicit type conversion from double to float.
if u note, even int and char have such a relationship.
ramthegreatcv- Posts : 55
Join date : 2009-01-30
Age : 36
Re: typecasting-"ek chota sa doubt story!!!"
http://en.wikibooks.org/wiki/C%2B%2B_Programming/Type_Casting
try this if u really want to learn about type-casting.like const and pointers,this needs a deeper insight.
all thanks to cutie
try this if u really want to learn about type-casting.like const and pointers,this needs a deeper insight.
all thanks to cutie
ramthegreatcv- Posts : 55
Join date : 2009-01-30
Age : 36
@dubey
actually jo constant humne diya hai agar hum f nahi lagate hai to compiler use integer treat karta hai n jab hum use float varialbe mien assign karte hia to uski upcasting karta hai
on the other sie
if we write f after constant it represents the value is float and it doesn't need any upcasting
on the other sie
if we write f after constant it represents the value is float and it doesn't need any upcasting
mnnnit.r- Guest
Re: typecasting-"ek chota sa doubt story!!!"
@Ramp
thanx man..u r right ..
but mr guest ..din get ur logic man..
i think u shd go thro wat ramp has said..his logic seems more perfect..
thanx man..u r right ..
but mr guest ..din get ur logic man..
i think u shd go thro wat ramp has said..his logic seems more perfect..
$corpion- Posts : 25
Join date : 2009-01-30
Age : 37
Similar topics
» Typecasting - Did you know this was C/C++ ?
» Catalan Number - "So the first post"
» difference between c/c++ - "Not all C is C++"
» Catalan Number - "So the first post"
» difference between c/c++ - "Not all C is C++"
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|