About 52 results
Open links in new tab
  1. What is the full "for" loop syntax in C? - Stack Overflow

    I have seen some very weird for loops when reading other people's code. I have been trying to search for a full syntax explanation for the for loop in C but it is very hard because the word …

  2. Endless loop in C/C++ - Stack Overflow

    Nov 25, 2013 · To me, writing for(;;) to mean infinite loop, is like writing while() to mean infinite loop — while the former works, the latter does NOT. In the former case, empty condition turns …

  3. How to end a loop early in C? - Stack Overflow

    Sep 19, 2012 · Break statements have a tendency to obscure the terminating logic of a loop. Imagine trying to deduce all of the logic of a very large loop with a break statements scattered …

  4. loops - For vs. while in C programming? - Stack Overflow

    There are three loops in C: for, while, and do-while. What's the difference between them? For example, it seems nearly all while statements can be replaced by for statements, right? Then, …

  5. c - Difference between "while" loop and "do while" loop - Stack …

    Sep 2, 2010 · The do while loop executes the content of the loop once before checking the condition of the while. Whereas a while loop will check the condition first before executing the …

  6. How do I declare several variables in a for (;;) loop in C?

    According to the C++ grammar (archived link), a for-init-statement (the part of the for-loop that you are asking about) can only be: a simple-declaration, e.g. int i = 5, j = 12, in which all declared …

  7. .net - How to escape a while loop in C# - Stack Overflow

    2 Which loop are you trying to exit? A simple break; will exit the inner loop. For the outer loop, you could use an outer loop-scoped variable (e.g. boolean exit = false;) which is set to true just …

  8. c++ - How do you loop through a std::map? - Stack Overflow

    How do you loop through a std::map? Asked 11 years, 1 month ago Modified 1 year, 2 months ago Viewed 1.0m times

  9. Do .. While loop in C#? - Stack Overflow

    Mar 29, 2010 · How do I write a Do .. While loop in C#? (Edit: I am a VB.NET programmer trying to make the move to C#, so I do have experience with .NET / VB syntax. Thanks!)

  10. c - Are multiple conditions allowed in a 'for' loop? - Stack Overflow

    Mar 15, 2014 · The above won't print out anything in the loop because the (i < p) condition fails immediately as i & p are both the same value (0). Update: Your example is valid (but silly) C …