|
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- FILE* fp;
- char filename[260];
- int pos, ch;
- fgets(filename, sizeof(filename), stdin);
- for(pos=0; pos!=260; ++pos)
- if(filename[pos] == '\n'){
- filename[pos] = '\0';
- break;
- }
- fp = fopen(filename, "r");
- if(fp == NULL)
- exit(1);
- for(ch = fgetc(fp); ch != EOF; ch = fgetc(fp))
- putchar(ch);
- return 0;
- }
复制代码
需要暂停的自己加暂停 |
|