C Examples Source Code Output
# C Example - Output the Source Code of the Current File
[ C Examples](#)
Output the source code of the current file. `__FILE__` is a constant representing the currently executing file.
## Example
#includeint main(){FILE *fp; char c; fp = fopen( __FILE__ ,"r"); do{c = getc(fp); putchar(c); }while(c != EOF); fclose(fp); return 0; }
The output is:
#include int main() { FILE *fp; char c; fp = fopen( __FILE__ ,"r"); do { c = getc(fp); putchar(c); } while(c != EOF); fclose(fp); return 0;}
[ C Examples](#)
YouTip