about problems encountered during the use of the For () loop (problems encountered in Tetris games)

Source: Internet
Author: User

Definition of A For loop:

for (parameter 1; parameter 2; parameter 3), parameter 1 is usually the initialization parameter, parameter 2 is the judgment, Parameter 3 is the operation of the parameter. None of these three parameters is required.

Here is to say, the use of parameter 1: such as the following language

                int nLine = 0, nList = 0;

1. for (nLine = 0; nLine < nline++)

{

......;

}

2. for (; nLine <; nline++)

{

......;

}

Here the parameter 1 is already initialized outside the for loop, does it need to be initialized in the for loop? This depends on whether you use this parameter or not elsewhere, and if nline is still used in 2, then the 2nd for Loop will have to be initialized with parameter 1, or the value of nline after the 1th for loop is not 0.

about problems encountered during the use of the For () loop (problems encountered in Tetris games)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.