0

I would appreciate it if someone helps me with itԅ(¯ㅂ¯ԅ)

https://code.sololearn.com/cw6IJ775a8ZI/?ref=app

5th Jan 2018, 3:43 AM
DaiYao
DaiYao - avatar
3 ответов
+ 5
In the main of the program, first you create an array stud of type 'Student' and store 5 values into it by calling the constructors for each element of the array. Now, in the second line, you create a pointer and store the address of the first object of the array into this pointer. So the pointer 'points' to the first element of the array. Now, since for an array, elements are stored in contiguous blocks of memory, when you perform increment on this address pointer, it simply moves to the next array element. So, the for loop prints the values of the first, third and fifth Student from the array 'stud'.
5th Jan 2018, 4:41 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 1
Thank you very much!!!-
18th Apr 2018, 11:19 AM
DaiYao
DaiYao - avatar
+ 1
i got it andit's very kind of you
18th Apr 2018, 11:19 AM
DaiYao
DaiYao - avatar