I'm having a vector subscript error when trying to compile. My code is here below. The program is designed to read a text file, and retrieve the questions and answers into a vector, then choose 5 random questions out of the 10 in the text file, then display the first on the screen. Each question has 6 lines in the text file: 1 for the question, 4 for the possible answers, and 1 for the correct answer.
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <ctime>
//FUNCTION PROTOTYPES
void SetQuestions(std::vector<std::vector<std::string>> &questionsChosen);
int main()
{
    //seed random number generator
    srand(static_cast<unsigned int>(time(0))) ;
    //RETRIEVE QUESTIONS FROM FUNCTION
    std::vector<std::vector<std::string>> questionsChosen;
    SetQuestions(questionsChosen);
    //Test if stored correctly
    std::cout << questionsChosen[0][0];
    return 0;
}
void SetQuestions(std::vector<std::vector<std::string>> &questionsChosen)
{
    //RETRIEVES ALL Q&A AND PUTS INTO 2 DIMENSIONAL VECTOR - questionsAll
    std::vector<std::vector<std::string>> questionsAll;
    std::ifstream fromFile("QA.txt");
    for (; fromFile.eof();)
    {
        std::vector<std::string> question;
        for (int i = 0; i < 6; i++)
        {
            std::string line;
            std::getline(fromFile, line);
            question.push_back(line);
        }
        questionsAll.push_back(question);
    }
    fromFile.close();
    //GENERATE RANDOM NUMBERS TO CHOOSE 5 RANDOM QUESTIONS
    int c1 = rand() % 9;
    int c2 = rand() % 9;
    //prevent duplicates
    while (c2 == c1)
    {
        c2 = rand() % 9;
    }
    int c3 = rand() % 9;
    while ((c3 == c1) || (c3 == c2))
    {
        c3 = rand() % 9;
    }
    int c4 = rand() % 9;
    while ((c4 == c1) || (c4 == c2) || (c4 == c3))
    {
        c4 = rand() % 9;
    }
    int c5 = rand() % 9;
    while ((c5 == c1) || (c5 == c2) || (c5 == c3) || (c5 == c4))
    {
        c5 = rand() % 9;
    }
    //COPY CHOSEN QUESTIONS INTO NEW ARRAY
    questionsChosen.push_back(questionsAll[c1]);
    questionsChosen.push_back(questionsAll[c2]);
    questionsChosen.push_back(questionsAll[c3]);
    questionsChosen.push_back(questionsAll[c4]);
    questionsChosen.push_back(questionsAll[c5]);
}
 
    