C 语言实例 - 输出当前文件执行代码
C 语言教程
· 2019-02-21 11:42:53
输出当前文件执行代码,__FILE__ 为当前执行的文件常量。
实例
#include <stdio.h>
int main() {
FILE *fp;
char c;
fp = fopen(__FILE__,"r");
do {
c = getc(fp);
putchar(c);
}
while(c != EOF);
fclose(fp);
return 0;
}
输出结果为:
#include <stdio.h> int main() { FILE *fp; char c; fp = fopen(__FILE__,"r"); do { c = getc(fp); putchar(c); } while(c != EOF); fclose(fp); return 0; }
点击查看所有 C 语言教程 文章: https://www.codercto.com/courses/l/17.html
HTML Dog
Patrick Griffiths / New Riders Press / 2006-11-22 / USD 49.99
For readers who want to design Web pages that load quickly, are easy to update, accessible to all, work on all browsers and can be quickly adapted to different media, this comprehensive guide represen......一起来看看 《HTML Dog》 这本书的介绍吧!