From the course: C Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Solution: Library card

Solution: Library card - C Tutorial

From the course: C Essential Training

Solution: Library card

(bright music) - [Instructor] Here's my solution for library catalog card challenge. This is 04-solution.cpp from chapter four of the exercise files. The structure for the card catalog card is at the top. It doesn't need to be here. You could have put it inside the main function and that would work also. The structure is pretty simple. I've used const care pointers for the strings and short integers for the numeric values. You could have also used character rays for the strings, simple ints would've worked fine for the numerics as well. Notice that the Dewey decimal value is two separate integers. This allows me to sort them more easily. These are numeric values and they're used that way. I print everything using cout and format as we've been doing throughout this course. And you notice that the Dewey decimal value is two integers separated by a period. Go ahead and run this and you can see my result here. So this is…

Contents