#include <iostream>
#include <new>
usingnamespace std;
int main ()
{
int n,o;
cout << "How many questions do you wish to answer?" << endl;
cin >> n;
cout << "How many characters will you use per answer?" << endl;
cin >> o;
char userAnswers[n][o];
return 0;
}
I couldn't figure out how to do the DMA. But not even this seems to work for me. I get these errors:
expected constant expression
cannot allocate an array of constant size 0
expected constant expression
cannot allocate an array of constant size 0
missing subscript
unknown size
To make an array of strings instead, just use string instead of char. Although I would suggest using a vector, since then you won't have to prompt them for how many questions they are going to answer. Also, if you use strings, you don't need a question for how many characters per answer, since strings are dynamically sized for you.