Hey everyone, I am taking an online C++ class and part of our assignment is to complete a whole bunch of small program snipits on a site called myprogramminglab.com. This one program seems to have me stumped as I am not very familiar with Data structures. Could someone help me out with this?

Assume that SREC has already been defined. Define a new type, ROSTER , that is a structure consisting of an int field, size , and another field, grades , that is an SREC array with 500 elements.

Edited by restrictment

5 Years
Discussion Span
Last Post by restrictment

Not sure, but if I were to guess, I would think that it would be something like this:

int SREC.testArray[500];


That's not a bad guess, but the assumption there is that SREC is its own type, so:

SREC grades[500];

No doubt you know how to declare simple integer variables:

int field;
int size;

Now the only problem is wrapping those three into a structure.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.