which of the following declacation would be permissible type
which of the following declacation would be permissible type instantiation in C++, assuming that aBox class took a single type parameter?
1- Box <int> myBox;
2- Box <PayrollRecord> myBox;
3- Box<3> myBox;
4- Box< int *> myBox;
5- Box< PayrollRecord *> myBox;
6- Box< PayrollRecord > *myBox;
7- Box<> myBox;
8- Box myBox;
-The answers are more than one
Solution
Answer:
Below are the declacations would be permissible type instantiation in C++
1- Box <int> myBox;
2- Box <PayrollRecord> myBox;
4- Box< int *> myBox;
5- Box< PayrollRecord *> myBox;
6- Box< PayrollRecord > *myBox;

