Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(void)
  5. {
  6. FILE * fp;
  7. char * line = NULL;
  8. size_t len = 0;
  9. ssize_t read;
  10.  
  11. fp = fopen("Ścieżka/zjebie", "r");
  12. if (fp == NULL) // Sprawdza czy otwiera
  13. exit(EXIT_FAILURE);
  14.  
  15. while ((read = getline(&line, &len, fp)) != -1) {
  16. printf("Dlugosc lini %zu :\n", read);
  17. printf("%s", line);
  18. }
  19.  
  20. fclose(fp);
  21. if (line)
  22. free(line);
  23. exit(EXIT_SUCCESS);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement