Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- int main(int argc, char* argv[])
- {
- FILE *f = fopen("filename.txt", "rb");
- fseek(f, 0, SEEK_END);
- long fsize = ftell(f);
- fseek(f, 0, SEEK_SET);
- char *str = malloc(fsize + 1);
- fread(str, fsize, 1, f);
- fclose(f);
- str[fsize] = 0;
- int count = 0, c = 0, i, j = 0, k, space = 0;
- char p[1000][512], str1[512], ptr1[1000][512];
- char *ptr;
- for (i = 0;i<strlen(str);i++)
- {
- if ((str[i] == ' ')||(str[i] == ',')||(str[i] == '.'))
- {
- space++;
- }
- }
- for (i = 0, j = 0, k = 0;j < strlen(str);j++)
- {
- if ((str[j] == ' ')||(str[j] == 44)||(str[j] == 46))
- {
- p[i][k] = '