Label

Thứ Năm, 28 tháng 10, 2010

How do you write an infinite loop using the for statement?

Question: How do you write an infinite loop using the for statement?

Answer:
for ( ; ; ) {

}




The three expressions of the for loop are optional; an infinite loop can be created as follows:

for ( ; ; ) {    // infinite loop

// your code goes here
}


Không có nhận xét nào:

Đăng nhận xét