Thread: Can you break; for for loop?

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    58

    Can you break; for for loop?

    Hi

    Can you stop a for loop with a break; command or something like it?

    D

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Write a silly for loop with a break in it and see.

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    58
    that would be... a yes

  4. #4
    Technical Lead QuantumPete's Avatar
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    894
    Quote Originally Posted by DavidDobson View Post
    that would be... a yes
    That would be ... a try it out for yourself
    Stuff like that is better learned by playing round with a simple program. Learning by doing and all that.

    QuantumPete
    "No-one else has reported this problem, you're either crazy or a liar" - Dogbert Technical Support
    "Have you tried turning it off and on again?" - The IT Crowd

  5. #5
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Just fyi, there is also a continue keyword for you to play with. Write a loop with continue and see what happens.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 03:25 PM
  2. Number to Word (Billions)
    By myphilosofi in forum C Programming
    Replies: 34
    Last Post: 02-04-2009, 02:09 AM
  3. get keyboard and mouse events
    By ratte in forum Linux Programming
    Replies: 10
    Last Post: 11-17-2007, 05:42 PM
  4. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 10:18 PM