2 Replies - 957 Views - Last Post: 14 April 2012 - 10:09 AM Rate Topic: -----

#1 Dzung   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 14-April 12

for loop

Posted 14 April 2012 - 09:58 AM

Hi,

I am new with c#. I wonder if anyone can answer this question: in a for loop as follows

for (; iNumber> 0; iNumber = iNumber/ jNumber)
{
}

the question is. what does it mean by the semicolon "the one infront of iNumber and after ( ".

thanks
Is This A Good Question/Topic? 0
  • +

Replies To: for loop

#2 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6536
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: for loop

Posted 14 April 2012 - 10:05 AM

for loop described in the MSDN documentation.

No offense. And its not that people don't want to help rookies... But there is a certain minimum amount of responsibility that the student should take upon themselves: Like reading a 'Learn C# in month' book, or any of the thousand of tutorials out there.

Asking ANY forum to explain each and every command of the C# language to you is just not something they can do every time a new student takes up coding. There are 500,000 members on this board. Can you image if every one of them asked this for every command of the C# language that is already well documented?

We have some great beginner tutorials on here. Walk through them. In addition here are a ton of starting resources:

Quote

Where do I start?


You start by learning a coding language FIRST.
Learn to plan before you type.
THEN you start designing software with a purpose.




Finding answers to specific problems:
Spoiler





If this sounds like you

Newbie/Rookie said:

I have a little programming experience but I need to write ...
read this section
Spoiler


Otherwise, you can just jump to the resources here:
Some of the tutorials below are for C# or Java not C, C++, VB.NET [...]. But the conceptual stuff of classes, object oriented design, events etc. are not language specific and should give you enough guidance in theory of program development for you to be able to look-up specific code example in your chosen coding language.



Resources, references and suggestions for new programmers. - Updated Mar 2012
Spoiler

This post has been edited by tlhIn`toq: 14 April 2012 - 10:07 AM

Was This Post Helpful? 0
  • +
  • -

#3 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5526
  • View blog
  • Posts: 14,527
  • Joined: 18-April 07

Re: for loop

Posted 14 April 2012 - 10:09 AM

The short answer, each piece of the for loop is optional. What you show there is a for statement where the initialization was left out. Nothing need to be initialized.

But I agree with tlhIn`toq, a little more research could have helped answer this for you. Google is your friend.

:)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1