Thread: help with one minor error

  1. #16
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Naughty!.. what's this?.. int choice = 0;
    And you're trying to input a character right?

    Well, you must replace int choice = 0; with char choice = 'x';
    No, actually, you should use 'int' here. All of the 'is*( )' functions, all of the 'getc' and 'putc' functions take integers as arguments, and return integers as return values. Additionally, if you're reading from a file, the EOF value is outside a 'char', so you have to read into an int to get the correct end result. As such, yes, use 'int'.

    Hope is the first step on the road to disappointment.

  2. #17
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    I figured out about the variable being an 'int' instead of a 'char' or 'string' on my own, but thanks anyway.

Popular pages Recent additions subscribe to a feed