Re: real newbie question on c#

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Mike Kearl (mkearl_at_hotmail.com)
Date: 04/11/04


Date: Sun, 11 Apr 2004 17:31:30 -0600

No they will not be available outside the for loop. You would need to
create the variables outside the loop

int var = 0;
int i = 0;

for(i = 0; i<args.Length;i++))
{
var1 = SomeFunction();
    if (args[i] > var1)
        break;
}

do something with var or i blah blah

"Raymond Du" <rdrd@yahoo.com> wrote in message
news:%23VgK$qBIEHA.828@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> //The following c# code:
> for (int i = 0; i<args.Length;i++)
> {
> int var1 = SomeFunction();
> if (args[i] > var1)
> break;
> }
> //Question: will i and var1 still be available outside the for loop, say
> from here?
>
> Thanks in Advance
>
>
>
>



Relevant Pages