1
I have a question asking that I calculate the volume value of an oil can, and thinking about it I will use float
. How do I place a unit of measure, for example the variable altura = 50cm
.
1
I have a question asking that I calculate the volume value of an oil can, and thinking about it I will use float
. How do I place a unit of measure, for example the variable altura = 50cm
.
2
It does not, it is the problem of the application to deal with this kind of thing, you establish which unit is manipulating, the code understands units of some, what this thing only the programmer knows, the code does not.
It’s even possible to create some sophisticated mechanism to deal with it, but in C it doesn’t pay.
So put 50 in altura
and be aware that are centimeters.
Browser other questions tagged c typing syntax
You are not signed in. Login or sign up in order to post.
show understood , but if it is a code that really needs to inform the unit I can put in the comments right?
– Vitor Gonçalves
You can, of course, or you must.
– Maniero