|
-
C Problem (Reading in input from user with loops)
Hi this is just a simple question for programing in C.
I have my main function using a while loop that gets 1 character at a time from the user.
When the user enter '1' it calls a different method add().
add() also asks the user for some input and does a simliair loop asking scanning in 1 character at a time.. The problem is that when I try inputing something in now it jumps back to the main loop.
For Example:
Please enter choice from 1-6:
(I enter 1)
It calls add()
Please enter number:
(I enter 54)
It goes back to the main method without doing anything and gives me:
Error: Please only enter number from 1-6.
How do i make it so it stays in the add method until i actually return?
Thx.
Similar Threads
-
By Transform in forum Java
Replies: 0
Last Post: 11-18-2005, 05:54 PM
-
By webchetan in forum ASP.NET
Replies: 1
Last Post: 11-16-2005, 05:01 AM
-
By Gerardo Gomez in forum VB Classic
Replies: 6
Last Post: 06-26-2000, 11:34 AM
-
By oSSiE in forum ASP.NET
Replies: 0
Last Post: 05-01-2000, 06:53 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks