← Back to Pointers
Question 677
Read a Player Struct Through an Arrow
Read a Player Struct Through an Arrow
ThePlayerstruct and the pointerptr(which points atp) are already set up, and the program reads a name and a score from input. Print the two fields usingptr->, then add 10 to the score throughptrand print it again. For the input: Ada 30 the expected output is exactly what is shown in Expected Output.
Expected Output:
Name: Ada Score: 30 Bonus score: 40
= newline. The output ends with a newline — print one after the last line.
Hints4 available
Sign in to use hintsTopics:
Pointers
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.