码迷,mamicode.com
首页 > 编程语言 > 详细

C语言- for 语句

时间:2017-05-12 13:26:01      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:cond   括号   false   for   condition   执行流程   span   多个   res   

for ( init-statement; condition; expression )
  statement  

init-statement -初始化语句
condition -循环条件,产生true或false的表达式
expression -表达式
statement -语句,多个语句可用花括号:
{
  包含多个语句的语句块
}

执行流程:
1、执行一次初始化语句。
2、检测 condition 为 false 将退出for循环流程!为 true,则会执行 statement,然后再执行 expression(一般在此预知运算会影响到 condition 为 false,否则为“死循环”),再执行2、检测 condition 如此循环下去..

C语言- for 语句

标签:cond   括号   false   for   condition   执行流程   span   多个   res   

原文地址:http://www.cnblogs.com/xenostudio/p/6844904.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!