Re: real newbie question on c#
From: Mike Kearl (mkearl_at_hotmail.com)
Date: 04/11/04
- Next message: DalePres: "Re: Disable Screen Saver"
- Previous message: Michael A. Covington: "Re: ***Stop:"
- In reply to: Raymond Du: "real newbie question on c#"
- Messages sorted by: [ date ] [ thread ]
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
>
>
>
>
- Next message: DalePres: "Re: Disable Screen Saver"
- Previous message: Michael A. Covington: "Re: ***Stop:"
- In reply to: Raymond Du: "real newbie question on c#"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|