Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc, char *argv[])
- {
- // Check for arguments and file pointer omitted
- FILE *f = fopen(argv[1], "r");
- char *times;
- int i = 0;
- for (i = 0; i < 2000; i++)
- {
- char line[80];
- if (fgets(line, 80, f) == NULL)
- break;
- //I want every line with the text "</time> to be added to string times
- if(strstr(line, "</time>"))
- {
- times = strcat(times, line); //This line is my problem
- }
- }
- printf(times);
- fclose(f);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement