0 votes
in C Plus Plus by

What's the order in which the objects in an array are destructed?

1 Answer

0 votes
by
Objects in an array are destructed in the reverse order of construction: First constructed, last destructed.

In the following Example, the order for destructors will be a[9], a[8], …, a[1], a[0]:

voiduserCode()

{

                 Car a[10];

                  ...

}

Pointers

Related questions

0 votes
asked Mar 6, 2022 in VueJS by sharadyadav1986
0 votes
asked Aug 4, 2023 in JAVA by DavidAnderson
...