C++ By Example 四 精彩文摘
香蕉小视频appUsing structures, you have the ability to group data and work with?the grouped data as a whole. Business data processing uses the?concept of structures in almost every program. Being able to ma-nipulate several variables as a single group makes your programs?easier to manage.
This chapter introduces the following concepts：
o Structure definitions
o Initializing structures
香蕉小视频appo The dot operator ( . )
香蕉小视频appo Structure assignment
香蕉小视频appo Nested structures
This chapter is one of the last in the book to present new?concepts. The remainder of the book builds on the structure con-cepts you learn in this chapter.
香蕉小视频appIntroduction to Structures
A structure is a collection of one or more variable types. As you?know, each element in an array must be the same data type, and you?must refer to the entire array by its name. Each element (called a?member) in a structure can be a different data type.
香蕉小视频appSuppose you wanted to keep track of your CD music collection.?You might want to track the following pieces of information about?each CD:
香蕉小视频appNumber of songs
香蕉小视频appThere would be five members in this CD structure.