Results 1 to 3 of 3

Thread: SOLVED - cin problems

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    I'm mobile
    Posts
    166

    Angry SOLVED - cin problems

    Hello,

    In my program I use cin to get info from the user and later on I use cin.getline. My problem is that when a user choses something with the help of cin in the beginning, it seem to left something in the cin-queue so that it sends something to my cin.getline and I can't enter something there because it's already got an "input".

    anyone care to help me with this?

    thanks!

    //alex
    Last edited by [praetorian]; Apr 12th, 2002 at 06:03 AM.
    [p r a e t o r i a n]

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Using cin.ignore() should clear out the stream. I forget the exact way to use it, but I'm sure you'll get it.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    I'm mobile
    Posts
    166

    thanks

    THank you!
    it works great!
    [p r a e t o r i a n]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width