C# Compared—For

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search
CSharp-Online.NET:Articles
C# Articles

C# Compared to Other Languages

© 2005 C. Gunnerson, et al.

For

The syntax for for loops is different in C#, but the concept is the same, except that in C# the operation performed at the end of each loop must be explicitly specified. In other words the following VB code

For i = 1 To 100
   ' other code here
}

can be rewritten as

for (int i = 0; i < 10; i++)
{
   // other code here
}


Previous_Page_.gif Next_Page_.gif


Personal tools