Guest User

Untitled

a guest
Nov 21st, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. ./Debug/main.c.o ./Debug/dot.c.o ./Debug/dataBase.c.o ./Debug/intPrompt.c.o
  2.  
  3. ./Debug/numWords.c.o ./Debug/LinkedList.c.o
  4.  
  5. void shortLines(char* f1, char* f2, int maxlen) {
  6. FILE* fp = fopen(f1, "r");
  7. FILE* fp2 = fopen(f2, "w");
  8. if (fp == NULL) {
  9. perror("File does not exist");
  10. }
  11. if (fp2 == NULL) {
  12. perror("File does not exist");
  13. }
  14. char singleLine[maxlen];
  15. char check;
  16. size_t len;
  17. do {
  18. fgets(singleLine, maxlen, fp);
  19. len = strlen(singleLine);
  20. if (singleLine[len-1] == 'n') {
  21. singleLine[len-1] = '';
  22. }
  23. fprintf(fp2, "%s", singleLine);
  24. } while ((check=getc(fp) != EOF));
  25. }
Add Comment
Please, Sign In to add comment