mercredi 19 avril 2017

Declaring vectors and pointers without creating any type objects

Given the c++ class Student and the declarations for: A)-An array that can hold 10 objects of type Student Student a[10]; B)-An array that can hold 10 pointers of objects of type Student Student *a[10]; C)-An STL vector c that can hold 10 objects of type Student vector c; D)- An STL vector that can hold 10 pointers of objects of type Student vector d

Which of the 4 (can be more than one) can be declared without creating any student objects?

My original thought was that all of them (a,b,c,d) but i was told that only the ones with pointers (b and d) could be declared without creating objects. I was hoping for some clarification on this. Thanks.

Aucun commentaire:

Enregistrer un commentaire