Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define BLOCK (1 << 14)
- char *text;
- int i, nelem;
- FILE *file;
- /* qua apro file */
- text = (char *)malloc(BLOCK * sizeof(char));
- i = 0;
- while((nelem = fread(text + i * BLOCK, BLOCK, sizeof(char), &file)) == BLOCK)
- malloc(text, ++i * BLOCK * text);
- text[i * BLOCK + nelem] = '\0';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement