determining array size from file input
so i have a file which the first line reads: x y
where x is the number of students
and y is the number of courses
e.g. 20 4
how can you extract the data and make it into an array size?
int size = stoi(line1);//Presuming you get size of array from a file
/* or just
grades >> size;
int* x = new int[size];
x = 1;//use array as you want
what if ... grades >> sizex >> sizey;
how would you extract for y ?
Last edited on
Topic archived. No new replies allowed.