Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
A try and catch block is in the loop for.
The assumption is when i = 2 source code is transferred to the catch. After the catch block should loop from i = 3 to continue
Posted
Comments
[no name] 29-Aug-12 13:00pm    
At first read, your narractive (nowhere is there a question) does not make any sense. When you read it carefully, not only does it not make sense but what it is that you think that you are trying to do is totally and completely wrong.
BillW33 29-Aug-12 13:02pm    
Post your source code and exactly where you are having a problem then someone will be able to help you.

1 solution

The following does continue to 3 and 4 after an exception when i = 2:

C#
for (int i = 1; i < 4; i++)
{
    try
    {
        int s = 1 /(i - 2);
    }
    catch
    {
    }
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900