How do I define a unit of measure in the value of the variable

1

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 .

    
asked by anonymous 05.08.2018 / 03:38

1 answer

2

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.

    
05.08.2018 / 03:51