CJCoding With Joseph
15free / daySign inCreate account

Read a Player Struct Through an Arrow

The Player struct and the pointer ptr (which points at p) are already set up, and the program reads a name and a score from input. Print the two fields using ptr->, then add 10 to the score through ptr and 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
Topics:
Pointers
📥 Auto-Input:
Ada 30\n
This input is automatically fed to your program's stdin
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.