Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Pls take a look at this peice of code :

 

int a=1;

int b=2;

try

{

if (a==b)

{

Console.WriteLine("wrong"); //This loop should never be enetred.

}

}

catch(Exception e)

{}

 

The if loop should never be entered, but it is entered inside the try block.Could someone tell me why???

 

 

Thanks.

Posted

yes, the message is never written to the screen, since the statement is never executed. but it enters the loop while i am debugging.i guess for some reason my debugger shows the line being debugged as one line ahead of what it actually is doing.Do you know why???

 

 

Thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...