Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Building Database Driven Catalogs

Authors: Sherif Danish

1st Edition

0070153078, 978-0070153073

More Books

Students also viewed these Databases questions