I'm having trouble reading information from .txt file into a struct when that info is spread across several lines of the file with some blank lines in between. The .txt file looks like:
1. What is the capital of Peru? 2 //2 being the key to the right answer
1. Santiago
2. Lima
3. Montevideo
4. Havana
2. Which is the largest planet in the solar system? 3
1. Saturn
2. Neptune
3. Jupiter
4. Uranus
My code is here: #10963301 - Pastie
However the output looks like this:
Code:
Question 1: What is the capital of Peru?
The options are:
1. Santiago
2. Lima
3. Montevideo
4. Havana
And the correct choice is option 2
Question 2: Which is the largest planet in the solar system?
The options are:
1. Santiago
2. Lima
3. Montevideo
4. Havana
5. Saturn
6. Neptune
7. Jupiter
8. Uranus
And the correct choice is option 3
The second question is picking up all the choices from the first question and then it's own options. I've tried a couple of other approaches (commented out in the program) but each produces it own set of quirks. If somebody could help me put the finishing touches here I'd be most grateful. Thanks,