#include "stdio.h"
void main()
{
FILE* fp;
int n[100];
int t=0;
if((fp=fopen("test.txt","r"))==NULL)
{
printf("失败\n");
}
while(!feof(fp))
{
fscanf(fp,"%d",&n++);
}
fclose(fp);
}
int i = 0;
while(!feof(fp))
fscanf(fp,"%d",&n[i++]);
优先级与运算顺序的问题, & 和 ++ 优先级相同,但右侧先运算。n 为数组名,不能执行自 ++ 或者 -- 的操作,因为它是常量指针。
2级优先级 右结合
! 逻辑非运算符
~ 按位取反运算符
++ 前缀增量运算符
-- 前缀增量运算符