Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. #define BLOCK ((1 << 14) * sizeof(char))
  6.  
  7. main()
  8. {
  9. FILE* file;
  10. char* text, temp;
  11. char mtr[13][80], tmp[80];
  12. int nelem=0;
  13. int i=0, j=0, k=0,n=0;
  14.  
  15. /* qua apro file */
  16.  
  17. text = (char *)malloc(BLOCK * sizeof(char));
  18. i = 0;
  19. while((nelem = fread(text + i * BLOCK, BLOCK, sizeof(char), &file)) == BLOCK)
  20. text=(char *)realloc(text, ++i * BLOCK * text);
  21. text[i * BLOCK + nelem] = '\0';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement