Thank you,
I am still getting used to this array buisiness.
I just came accross another problem.
Is there a way that I can compair a 1-dementional array, with a 3-dementional array?
here is my problem. I don't know why the two strings (ans[80] and Answer[5][6][80]) will not compair properly. (Look at line 28).
Code:
#include <iostream>
using namespace std;
void Com_ans();
char ans[80];
char cat = 0; // choose from catagory 0.
char qst = 0; // choose question 0 within catagory 0.
int main()
{
cout << "What is the answer in colomb 0 question 0? ( type \" answer1\")";
cin >> ans;
Com_ans(); // call the Com_ans function to compair answers.
system("PAUSE");
return 0;
}
void Com_ans()
{
char Answers[5][6][80]=
{ "answer1", "a2", "a3", "a4", "a5", "a6", //Table of answers.
"1", "2", "3", "4", "5", "6",
"1", "2", "3", "4", "5", "6",
"1", "2", "3", "4", "5", "6",
"1", "2", "3", "4", "5", "6"
};
if(ans == Answers[cat][qst]) // Here is my problem, how can I compair the to strings?
cout << "!!Correct!!" << Answers[cat][qst];
else cout << "Rong Answer, Try again";
return;
}