📄 readfile.c
字号:
#include <stdio.h>int main() { int array[10]; FILE * file; int i=0, j=0, p=0, m=0; char temp; char mytemp; file = fopen("test.txt", "r"); while (!feof(file)) { if ((mytemp= fgetc(file)) != '\n') { ungetc(mytemp,file); fscanf(file, "%d", &array[i]); i++; } } for (j=0; j<10; j++) { printf("%d ", array[j]); } fclose(file); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -