Converting Common Temperature Types
The real inspiration for this program was IRC. I'm forever talking
about temperatures with people outside the USA (who use a rational
system) and need to convert _fast_.
But a quick google showed nothing suitable, though I'm sure just
about every student has written something like this.
You can download the source here.
Instructions are in the readme file, and couldn't be much clearer, but
this is the idea:
Call ctemp with no flags, and it converts from Fahrenheit to Celsius,
You can enter as many temperatures and flags as you like. Temps
subsequent any flag will get the same conversion.
There are six valid flag conversions, each starting with "-":
-fc, -fk, -cf, -ck, -kf, -kc
In all cases, the first letter indicates input type, and the second
indicates the desired output.
ctemp -fc 32 44 -cf 0
0.0 degrees celsius
6.7 degrees celsius
32.0 degrees fahrenheit
As a side-effect of atof(), you can input tempertures in hexadecimal
with good effect. You may also use scientific notation, as in 2.3e100
in the normal "c" fashion.