0
I would appreciate it if someone helps me with itԅ(¯ㅂ¯ԅ)
3 Antworten
+ 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'.
+ 1
Thank you very much!!!-
+ 1
i got it andit's very kind of you