Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- FILE *f;
- //neu chon 1
- f=fopen("demo.txt","+a");
- //Neu khong chon lua chon 1 thi dat f=stdout
- f=stdout;
- //khi do 2 lenh sau tuong duong
- printf("1");
- fprintf(f,"1");
- //Co nghia la: fprintf in ra FILE * f,
- //con printf in ra FILE * stdout.
- //khi ta gan f=stdout => fprintf tuong duong lenh printf
- }
Add Comment
Please, Sign In to add comment