Reputation: 9
int main()
{
int rows=0;
int studId,course;
char ch;
while(FileIn>>studId>>course)
{
for(int i=0;i<5;i++)
{
FileIn>>ch;
}
rows++;
}
char** questions = new char*[rows];
What is the meaning of new char*[rows]
? if rows = 10.
The file content is
20 1 A B C D E
20 1 A B C D E
20 1 A B C D E
20 1 A B C D E
20 1 A B C D E
20 1 A B C D E
20 1 A B C D E
20 1 A B C D E
20 1 A B C D E
20 1 A B C D E
Upvotes: 0
Views: 55
Reputation: 11
since 'questions' is double pointer, it is made to point an array of pointers of size rows using new char*[rows] that is, after char** questions = new char*[rows];, questions can be made to point to pointers of type char. Hope I answered your question.
Upvotes: 0