و سپس محتویات فایل را خوانده و در صفحه نمایش نشان می دهد .

#include
#include
#include
#include
#define  TAB_SIZE   8
#define  OUT  1
#define  IN   1
void err(int) ;
int main(int argc , char *argv[])
{
    FILE *in , *out;
    int tab, i ;
    char ch ;
    clrscr();
    if(argc != 3){
 printf("\n incorrect number of parameters") ;
 getch() ;
 exit(1) ;
    }
    in = fopen(argv[1] , "r");
    out = fopen(argv[2] , "wb") ;
    if (!out) {
 printf("\n cannot open output file.") ;
 getch() ;
 exit(1) ;
    }
    tab = 0;
    do {
       ch = getc(in) ;
       if (ferror(in))
 err(IN) ;
       if(ch == '\t') {
  for (i = tab; i < 8; i++)  {
     putc(' ' , out) ;
     if (ferror(out))
        err(OUT) ;
  } //end of for
  tab = 0;
       } //end of if
      else {
    putc(ch , out) ;
    if (ferror(out))
       err(OUT) ;
    tab ++ ;
    if (tab == TAB_SIZE || ch == '\n' || ch == '\r')
       tab = 0;
      }//end of else
    } while (!feof(in)) ;
    fcloseall() ;
    printf("Successfuly changed!");
    getch();
    return 0;
}
//************************
void err(int eror)
{
     if (eror == IN)
       printf("\n error on input file. press a key ...");
     getch() ;
     exit(1);
}