Doesn't make it to the cin getline function again, why? Labeled & Er. Chked

This is a discussion on Doesn't make it to the cin getline function again, why? Labeled & Er. Chked within the C++ Programming forums, part of the General Programming Boards category; Ok, so I've gone through Error checking on this, and the program doesn't seem to make it back to the ...

  1. #1
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    Question Doesn't make it to the cin getline function again, why? Labeled & Er. Chked

    Ok, so I've gone through Error checking on this, and the program doesn't seem to make it back to the input after a multi word answer has been put in, I labeled the part where it all goes wrong. You can download the source or I'll point out the 3 or 4 lines right here:

    Code:
    mainlp=1;
    	while(mainlp!=0)
    	{
    		line=0;
    		input="";
    		responce="";
    		getch();
    		system("cls");
    		cout << ">> ";
    		getline(cin,input);        //Never Gets To This Input After Multi Word Answers, Why?
    		cout << input;
    		input=lower(input);
    		cout << endl << input;
    		cortana::find_line();
    		cout << responce << endl << endl;
    	}
    I know that part's a little messy, but that's basically my main interface so It probably will remain that way. Here's the zip.
    Last edited by drdroid; 03-01-2003 at 08:33 PM.

  2. #2
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    Post .....

    Downloads: 5
    Responces: 0

    Come on, responces can still catch up.

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Haha, I love the way you bump $$$$. I'll have a look after the
    movie.

  4. #4
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    ...

    downloads have scored 2 more points in the second quarter, will the downloads make up the necessary scores? Let's find out, now on the second half.

  5. #5
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    hey!!!

    HEEY the cin.ignore thing worked.

  6. #6
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    put this in after every input

    cin.clear();
    cin.ignore(80, '\n');

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 09:18 PM
  2. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  4. cin not allowing input after first use of function
    By Peter5897 in forum C++ Programming
    Replies: 5
    Last Post: 01-31-2006, 06:29 PM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21