this is probably a dumb question but how would I remove the array so that there is no max size on it.

struct StudentType
{
    string studentName;
    int testScore;//Between 0 and 100
    char grade;
};

const int NUM_STUDENTS = 20;

int main()
{
StudentType student[NUM_STUDENTS];
}


this is what i have tried


    StudentType i;

StudentType *student;

student = new (nothrow) StudentType [i];

Use a pointer and expand the array as needed. Better yet, use std::vector or std::list, both will auto expand for you. For example:

StudentList* Students; // pointer to an array

or

std::vector<StudentType> Students;

thanks a lot!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.