+ 2

About pointers in class

I want to create pointers for array of objects of the class? How is it? Ex:i have class. I create objects like obj[5]; I want to done this using pointer of new operator. Please explain me with examplr program?

18th Feb 2021, 4:47 PM
Jawahirullah
Jawahirullah - avatar
2 Answers
18th Feb 2021, 5:38 PM
JaScript
JaScript - avatar
+ 2
class* obj = new class[5]; Remember to delete obj with: delete[] obj;
18th Feb 2021, 5:09 PM
äœ çŸ„é“èŠć‰‡ïŒŒæˆ‘äčŸæ˜Ż
äœ çŸ„é“èŠć‰‡ïŒŒæˆ‘äčŸæ˜Ż - avatar