I am getting a few crashes related to the fact that I use a vector in my struct that may have to use about 6000 elements. Here is my struct:
struct Students
{
char* names;
std::vector<int> scores;
};
Is there a way to make it so my vector is not causing my struct to cause an error. Here is my calling code.
while(scores.hasNext())
{
students[current_student].scores.push_back(grade);
}
My question: if this is a problem with size allocation of a vector within a struct, could I declare a pointer to a vector and deference my vector instead of having it actually in the struct?
Grades is just an integer.
studentsandgrade? Give the error message too.