cout << "How many questions are there going to be on this exam?" << endl;
cout << ">>";
getline(cin, totalquestions);
この小さなコードは、私が作成したクラスの関数からのものでありtotalquestions
、for ループを実行して、私が尋ねた質問の合計量を尋ね続けることができるように、int にする必要があります。
question q;
for(int i = 0; i < totalquestions; i++)
{
q.inputdata();
questions.push_back(q);
}
このコードはどこで機能しますか? 誰かがこれを機能させるためのアイデアを持っていますか?