Advertisement
anwar0101

Remove forward slash comment

May 29th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.67 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. main()
  4. {
  5.        FILE *input, *output;
  6.        char c;
  7.  
  8.        input = fopen("source.txt", "r");
  9.        input = fopen("output.txt","w");
  10.        
  11.        while((c=fgetc(input))! =EOF)
  12.        {
  13.              if(c=='/')
  14.              {
  15.                   c=fgetc(input);
  16.                   if(c=='/')
  17.                  {
  18.                         while((c=getc(input))! = '\n')
  19.                        {
  20.                                 //
  21.                         }
  22.                   } else
  23.                   {
  24.                         fprintf(output,"/");
  25.                   }
  26.               }
  27.              fprintf(output,"%c",c);
  28.        }
  29.        
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement