Thread: Break the Loop.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Apr 2011
    Location
    Karachi, Pakistan
    Posts
    19
    > sprintf(out,">>>%s option selected",&menu[i]); // puts the output into out[]
    > while( strcmp(&menu[6][0],out) != 0); /*exits loop if the output is "quit"*/
    Maybe compare with the input, not the output?
    Salem that worked...really!!
    Are you a witch-doctor!!??
    ...your name suggests it though, and your problem-solving skills too.

    Well, jokes aside. So tell me what has anyone not told me about gets()??

  2. #2
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Quote Originally Posted by Lord Slytherin View Post
    Salem that worked...really!!
    Are you a witch-doctor!!??
    ...your name suggests it though, and your problem-solving skills too.

    Well, jokes aside. So tell me what has anyone not told me about gets()??
    You should read: Why gets() is bad-FAQ
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Best way to break out of loop
    By Ducky in forum C++ Programming
    Replies: 31
    Last Post: 09-07-2010, 11:22 PM
  2. how could I break this loop?
    By Trafalgar Law in forum C Programming
    Replies: 4
    Last Post: 09-27-2008, 05:11 AM
  3. Can you break; for for loop?
    By DavidDobson in forum C Programming
    Replies: 4
    Last Post: 09-24-2008, 12:59 PM
  4. Loop will not break.
    By silhoutte75 in forum C Programming
    Replies: 1
    Last Post: 03-20-2008, 06:51 PM
  5. Need help with break in do while loop
    By JoelearningC in forum C Programming
    Replies: 3
    Last Post: 03-19-2008, 11:12 PM