Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

while(1) - mysterious code optimization

Status
Not open for further replies.

topgraphie

Programmer
Apr 20, 2012
1
DE
Hi
Borland c++6.0, all code optimization off. In the fault case - see code - debugger bypasses the entire loop including the trailing i=0 statemenet. What's wrong?
tY

void __fastcall TForm1::Button1Click(TObject *Sender)
{
int i=0;
while(1)
{
// i++; // doesn't work
if(i==10000) break;
i++; // works
}
i=0;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top