Question: Suppose we have a C++ class called student. There are many ways one can create a collection student objects. Among these: one can use a

Suppose we have a C++ class called student. There are many ways one can create a collection student objects. Among these: one can use a normal C++ array or an STL vector, and one could create a collection of objects, or of pointers to objects (presumably allocated on the heap.) a. Write a line of C++ code that declares an array a that can hold 10 objects of type student b. Write a line of C++ code that declares an array b that can hold 10 pointers to objects of type student. c. Write a line of C++ code that declares an STL vector c that can hold 10 objects of type student d. Write a line of C++ code that declares an STL vector d that can hold 10 pointers to objects of type student In the previous problem, you were asked to write four different declarations, (a), (b), (c) and (d). Each of these has "pros" and "cons". There are also differences among them that we might describe as "neutral", for whether they are a pro/con depends on the context. For the "pros" and "cons" below, please indicate which of the letters above (a, b, c, d) the statement applies to. Note that in some cases, you may have to indicate more than one letter. Circle the letters to which the statement applies. If you mess up, cross out all the letters and list the letters in the space to the right
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
