Users Entry Causes Segfault

I need the user to enter an int and press enter. If they enter several chars before pressing enter it causes a segfault. How can I get the first char of the line that they enter?
Topic archived. No new replies allowed.