thieumao

docfile.c

May 21st, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(int argc,char**argv){
  4.     argv[0] = "/home/thieumao/Desktop/thieumao.txt";
  5.     FILE*fd=fopen(argv[0],"r");
  6.     if(fd==NULL) {
  7.         puts("error open file");
  8.         exit(1);
  9.     }
  10.     int ch;
  11.     while((ch=fgetc(fd))>0){
  12.         putchar(ch);
  13.     }
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment