SHARE
TWEET

FILE stream

finalshare Nov 28th, 2016 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main(){
  4.     FILE *f;
  5.     //neu chon 1
  6.  
  7.     f=fopen("demo.txt","+a");
  8.  
  9.     //Neu khong chon lua chon 1 thi dat f=stdout
  10.     f=stdout;
  11.     //khi do 2 lenh sau tuong duong
  12.     printf("1");
  13.     fprintf(f,"1");
  14.     //Co nghia la: fprintf in ra FILE * f,
  15.     //con printf in ra FILE * stdout.
  16.     //khi ta gan f=stdout => fprintf tuong duong lenh printf
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top