Replying to C++ Coding HELP
yes i know this is newschoolers but i know some of you MF are good at coding and im stuck as hell.and all the other compsci forms arent much help with this.
So im making a drinking game for a final project that asks players questions and then checks if the input is the answer to said problem,
I have the questions and answers saved in a 2D array of size 20x2, mathProbs[j]; i being questions j being the answers.
how do I output only questions and then check if the input matches the answer stored? I can output both but I cant get it to output only one without an error, I also need it to step one down the list (array)after each answer.
here is what i got thus far.
C++ language
//*****************************************************
string FileIOthing(){
int prob=0;
int answer=0;
string ans;
string mathProbs[20][2];
ifstream file;
file.open("mathProblems.txt");
if(file.is_open())
{
for(int i = 0; i < 20; i++)
{
for(int j = 0; j < 2; j++)
{
file >> mathProbs[j];
// cout
Click to expand post