+ 1

How can i create an array of a class type ? I mean array having ot type to be of a class name like classname arrayname

c++

10th May 2017, 1:52 PM
Alaro Abubakar Olayemi
Alaro Abubakar Olayemi - avatar
4 odpowiedzi
+ 1
I tried that but the compiler see's it has error or is that not like class name nameofarray[] right?
12th May 2017, 9:17 AM
Alaro Abubakar Olayemi
Alaro Abubakar Olayemi - avatar
+ 1
Thank you very much. it has accept it
15th May 2017, 10:21 AM
Alaro Abubakar Olayemi
Alaro Abubakar Olayemi - avatar
0
you can do it... class myClass { ... } myClass arrayOfClass[n];
10th May 2017, 2:07 PM
Toky R.
Toky R. - avatar
0
you must declare the size of the array : ClassName arrayName[10]; // for example
12th May 2017, 7:51 PM
Toky R.
Toky R. - avatar