A struct defines a collection of named members that can have different types. The dot operator accesses a member of a struct object. A bounded character array stores the name within this record.
Read the example
The complete program appears below. Read it first, predict the output, then run it.
Expected output
Job 105: Laptop, 450.00
Practise
Add a status field and initialize it. Create a second record with different values.
Common mistake
A fixed character array has limited capacity. Copying arbitrary input into it without bounds checks is unsafe.