Quote Originally Posted by Todd Burch View Post
You could also create another variable to hold this result since it never changes, and there's no need to recalculate it for EVERY STINKING CHARACTER.

Code:
int delta = 'c' + 'd' - 't';
Although the compiler can calculate the sum/difference of a few constants in that simple way. And even if it didn't, it would still disappear in the noise in a profile, compared to fgetc()/fputc() - I'm sure the processor can add/subtract in something like 3 clock-cycles (on a reasonably modern processor - 486 or better), whilst fgetc() is bound to take a few hundred cycles.

--
Mats