how can i go back to the previous line if user enters a wrong input, im using C programming
zee93 0 Newbie Poster
Recommended Answers
Jump to PostIf user enters wrong data then display an appropriate error message then re-display the original question. Best way to do that is to put all that in a loop and break out of the loop only when user enters correct data.
Jump to PostThe negative rep probably was for your use of the goto statement instead of the more standard loop. The code you posted does not even attempt to do what you just described.
Jump to Post>> kingsonprisonic.
???
Jump to Post>> kingsonprisonic.
???
The guy who posted using goto, once again assuming you're replying to me. Could you be more clear with whom you're replying to and why, please?
Jump to PostYou got neg rep from me because you are telling a student uncomfortable with
1) programming -- he's NEW!!
2) English -- he's from MalaysiaI'm sorry, I didn't realize I was supposed to read his mind and determine that what he asked for wasn't what he really wanted. :icon_rolleyes:
…
All 17 Replies
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
WaltP commented: Terrible suggestion! GIU is not a solution. -4
kingsonprisonic commented: Its a bad solution. -1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ab000dy_85 -3 Junior Poster in Training
zee93 0 Newbie Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
deceptikon commented: Not what the OP asked for. -1
Ab000dy_85 -3 Junior Poster in Training
Ab000dy_85 -3 Junior Poster in Training
kingsonprisonic 42 Posting Whiz in Training
deceptikon commented: Faking a loop with goto is very rarely the right thing to do. -1
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ab000dy_85 -3 Junior Poster in Training
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.