Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int index = 0;
- char *all_questions[20];
- char *all_answers[20];
- char *answer;
- char *question;
- int main()
- {
- FILE *myfile = fopen("D:\\CCrossword\\sample.txt", "r");
- if (myfile == NULL)
- {
- printf("Blad przy otwieraniu pliku!\n");
- exit(1);
- }
- char line[256];
- while (fgets(line, sizeof(line), myfile)) {
- answer = strtok(line, "|");
- question = strtok(NULL, "");
- all_questions[index] = question;
- all_answers[index] = answer;
- //printf("%s\n", all_questions[index]);
- index++;
- printf("%s\n", all_questions[1]);
- };
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement