Don't assume stdin and stdout are compile-time constants. Initialize globals at the top of main instead. ok espie