Problem Statement - Array of Structure – Output Writing
Find and write the output of the following C++ program code:
Note: Assume all required header files are already being included in the program.
struct Score { int Year;float Topper; }; void change(Score *s,int x=10) { s->Topper=(s->Topper+15)-x; s->Year++; } int main() { Score Arr[]={{2006,100},{2007,85}}; Score *point=Arr; change(point,40); cout<<Arr[0].Year<<'#'<<Arr[0].Topper<<endl; change(++point); cout<<Year<<'#'<<Topper<<endl; return 0; }
Solution
CSKC| Created: 19-Feb-2020 | Updated: 19-Feb-2020|