C Cannot Access A Closed Stream Error Throwing Stack Overflow

C Cannot Access A Closed Stream Error Throwing Stack Overflow