+ 2

Array of objects

What is the use of line 14, 15 and 16 while there is line 13? What does line 13 do? https://code.sololearn.com/c2TwxvvW4W4l/?ref=app

20th Nov 2021, 5:59 AM
Rishi
Rishi - avatar
3 odpowiedzi
+ 6
The line 13 make the array of objects but every element of this array acutely is a pointer to object so when you make array you just make a pointers and the line 14,15,16 are making the pointer pointing to an object.
20th Nov 2021, 6:19 AM
Zein Khalil
+ 2
Jay Matthews Zein Khalil tnx @Zein Khalil "every element of this array acutely is a reference" is what you meant?
20th Nov 2021, 12:32 PM
Rishi
Rishi - avatar
+ 2
Rishi Exactly
21st Nov 2021, 3:15 PM
Zein Khalil