K&R C Programs Exercise 5-2
Exercise 5-2. Write getfloat, the floating-point analog of getint. What type does getfloat return as its function value? getfloat returns int — the same as getint. This might seem surprising since it reads a double. The return value is used as a status indicator: it returns the terminating non-numeric character (so the caller can check …