I have a question asking me to calculate the volume value of an oil can, and thinking of that I will use float
. How do I put a unit of measure, for example the variable altura = 50cm
.
I have a question asking me to calculate the volume value of an oil can, and thinking of that I will use float
. How do I put a unit of measure, for example the variable altura = 50cm
.
It does not, it's the application problem dealing with this kind of thing, you establish which unit it 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 handle this, but in C it does not make up.
So keep 50 in altura
and be aware that they are centimeters.