This is my quizzer so far. The problem is that I want a multiple choice answer system. ATM the quizzer converts the sting into a '3d' char array, if their is an underscore it will divert the copying onto a different part of the array.
This is how the string is stored after conversion:
{{{question}{answer}}{{question}{answer}}{{question}{answer}}}
Once this section has been phased the loop of questioning begins.
Should I make it a 4d array to allow a multiple choice answers?
char qa[100][100][100];
string response;
int questionNo;
int range;
//Leave a underscore after each question/answer
//add as many questions/answers as pos
string strqa = "Name?_alastair_Dad?_roger_Cat?_lilly_House Number?_24_Country?_england";
int main(void)
{
int currentletter=0;//this does changes
bool convert = 1;
int b = 0;
while (convert == true)
{
for(int i = 0;; i++,currentletter++)
{
if (strqa[currentletter] == '_')
{
currentletter++;
break;
}
qa[b][0][i] = strqa[currentletter];
}
for(int i = 0;; i++,currentletter++)
{
if (strqa[currentletter] == '_')
{
currentletter++;//this adds one to compensate for the space
break;//breaking never does bottom part of loop
}
qa[b][1][i] = strqa[currentletter];
if (strqa.size() -1 == currentletter)
{
convert = false;
goto breakloop;
}
}
range += 1;
b++;
}
breakloop:
range += 1;
while(1>0)
{
system ("cls");
//______________This is the random generator for the question
cout << "the range is from 0 to " << range -1 << endl;