← Back to Structs
Question 397
Define a Struct Type with typedef
Define a Struct Type with typedef
Usetypedefto define a struct type namedRectthat has twointfields,widthandheight. ARectis then created withwidth5 andheight3, and its fields are printed separated by a space (see Expected Output). Themainfunction is already written; you only need to define theRecttype. There is no trailing newline.
Expected Output:
5 3= newline. No newline after the last line.
Hints4 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.