Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7622515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:28:25+00:00 2026-05-31T04:28:25+00:00

I ran into strange situation here is what happens. I am using a do

  • 0

I ran into strange situation here is what happens. I am using a do while loop and it exceutes a while function one more time after brake.
Here is a simplyfied version of what happens:

int i = 0;
do{
if(i>=1) break;
}while(i++);

And after this i value is 2. I am just curious if that is how it should be or I just made an error somewhere in my more copmlex version of this code?
This is an easy fix for this I just have to assign a to say an iTemp variable in the begining of the wgile and use that insted of i.

P.S. I was using two do while loops one inside of another maybe that is what caused it?

EDIT: Cmon people give me a break it was typo. 😀

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:28:27+00:00Added an answer on May 31, 2026 at 4:28 am

    P.S. I was using two do while loops one inside of another maybe that is what caused it?

    It could well be. A break (note the spelling) will only break out of one loop, so if it was inside the inner loop, it would break out of that loop, but continue execution immediately after the end of the inner loop. In the (fairly common) case of the outer loop ending immediately after the inner, you’d end up executing the condition of the outer loop again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into a strange issue over the weekend while I was working on
(this is regarding the Ramaze.net framework) I ran into some really strange problems while
I ran into a strange problem today, after renaming a couple of images in
I ran into a strange problem using a C# webservice client to call a
I'm working with a nullable DateTime object and ran into some strange behavior. Here's
I ran into a strange issue. Here is a snippet of code that describes
I just upgraded to XCode 4.0.2 and ran into a strange issue. Every time
I ran into a strange problem these days. One of my apps which is
I was working on a method yesterday and ran into something strange, here is
While making my code, i ran into a strange problem. I hold 1 file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.