码迷,mamicode.com
首页 > 其他好文 > 详细

89 循环条件的另一种写法

时间:2018-05-14 00:53:19      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:strong   while   read   sys   clu   str   chm   nbsp   pause   

#include<stdio.h>
#include<stdlib.h>
void main() {

FILE*read = fopen("2", "r");
if (!read) {
printf("打开失败\n");
system("pause");
return;
}
char teamp[200] = { 0 };

int cbbc = NULL;
while (!feof(read)) {
fgets(teamp, sizeof(teamp), read);
int llyy = ftell(read);
if (llyy != cbbc) {
printf("%s", teamp);
}
}
fclose(read);
system("pause");
}

start
l_start


只要循环体的条件是类型.

xx == 0{ 执行里面的代码}
我们都可以写成
!xx{执行里面的代码}  逻辑非运算

89 循环条件的另一种写法

标签:strong   while   read   sys   clu   str   chm   nbsp   pause   

原文地址:https://www.cnblogs.com/xiaodaxiaonao/p/9034123.html

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