Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

help debugging

Name: Anonymous 2010-10-05 19:18

I'm trying to debug my program can anybody help?

Here's a part of the code

cin >> order;
while(order!=1 && order!=2 && order!=3){
cout << "Invalid input, please input valid input"<< endl;
cin >> order;

When I enter negatives and 0 it works fine, but when I enter letters it goes into an infinite loop of "Invalid input, please input valid input". Any way I can fix this?

Name: Anonymous 2010-10-05 19:22

Clear the input stream after you cin.

Name: Anonymous 2010-10-05 19:24

Learn the language you're trying to use.

Name: Anonymous 2010-10-05 19:29

>>3
I'm trying. I just started this programming course and there isn't much to go on.

Name: Anonymous 2010-10-05 19:36

>>4
there isn't much to go on.
Yes, you're clearly the first person ever to learn Sepples, and there are no textbooks or tutorials or anything. Fucking lazy cunt.

Name: Anonymous 2010-10-05 19:57

PROFESSIONAL TIP:
You are using Sepples.  Try using a language other than Sepples, such as C.

Name: REQUESTING AMATEUR TIP 2010-10-05 21:01

REQUESTING AMATEUR TIP

Name: Anonymous 2010-10-05 21:04

You are using Sepples.  Try using a language other than Sepples, such as C.
What is this "C U+0010" you speak of?

Name: Anonymous 2010-10-05 21:05

AMATEUR TIP:
seriously your problem is too simple to give you help on. there are people who debug with cout statements only. if you are to lazy to swap out variables in a cout statement to fine where the problem is then you are missing the whole point of programming

Name: Anonymous 2010-10-05 23:17

>>7
I've got a little TIP for you. Get the POINT?

Name: AMATEUR TIP MEME FAN 2010-10-05 23:25

>>9
Thank you!

Name: Anonymous 2010-10-05 23:50

>>10
This is the END for you, you gutter-crawling cur!

Name: Anonymous 2010-10-06 4:52

>>12
My other cur is a cdr!

Name: Anonymous 2010-12-21 9:05

Name: Anonymous 2011-02-03 1:55

Don't change these.
Name: Email:
Entire Thread Thread List