I have a problem to read data from a Database.txt file. The file contains the questions and answers for the quiz, and I have to read it from a file and put it to a structure so I can use it in program. I have done this with a binary file, but unfortunately I must use txt.
this is an example of questions in txt file. Of course, there are more, but I'll put just 2 of them here.
1. Koji programski jezik nije objektno orijentisan? //this is a question
4)C //these 4 are the answers
4 // and this is the number of the correct answer
2. Sta je od navedenog model boja u racunaru?
now I will give you the structure I have made to put the data from the file in:
Thanks in advance!
char question[MAX], answers[MAX];
// and I have tried to read the file and put it in a structure with this code, but it doesn't work
struct milioner q[BROJ];
printf("Error reading file.");