Question: Consider the following questions about structures. (a) (5 Points) Declare a struct called song that stores a song's title, artist, year, genre, and the cost

 Consider the following questions about structures. (a) (5 Points) Declare a

Consider the following questions about structures. (a) (5 Points) Declare a struct called song that stores a song's title, artist, year, genre, and the cost (of either a CD or a tape). Use 2. Oldies. Use a union to allow the cost to be for either a CD or tape. Use an additional enumeration to keep track of what media type the cost is for. (b) (2 Points) Declare the variable songPtr that points to a song structure. Also, allocate memory for the structure. (c) (3 Points) Initialize the structure pointed to by songPtr to have the title Jaded", the artist "Aerosmith", the release year 2001, the genre Rock, and the cost to $17.99 for a CD. Don't forget to set the enumeration variables

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!