← Back to Structs
Question 405
Read a Field Through a const Pointer
Read a Field Through a const Pointer
Astruct Pointwithx = 8andy = 9is pointed to by aconst struct Point *ptr, meaning you may read the struct but not modify it through the pointer. Print the sum of its two fields (see Expected Output). Access the fields withptr->xandptr->y. There is no trailing newline.
Expected Output:
17= newline. No newline after the last line.
Hints2 available
Sign in to use hintsTopics:
Structs
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.