Alx09

Untitled

Jul 11th, 2020
1,503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5.  
  6. int main() {
  7.     FILE *f, *g;
  8.     char c;
  9.     f = fopen("text.txt","r");
  10.     g = fopen("text2.txt", "w");
  11.     while (fscanf(f, "%c", &c) != EOF)
  12.         if (c != ' ' && c != '\n')
  13.              fprintf(g, "%c", c);
  14.     fclose(f);
  15.     fclose(g);
  16.     return 0;
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment