CMPSC 16 Lecture Notes - Lecture 17: Type Qualifier, Member Variable
Document Summary
Class = data type whose variables are objects int and char are predefined data types ifstream and string are predefined classes. To define a class, you need to: describe the kinds of values the variable can hold. Ie numbers, characters, etc: describe the member functions. Contains multiple values of various types: member variables, logically related to one another and come together as a single item. The st(cid:396)u(cid:272)tu(cid:396)e tag is the (cid:374)a(cid:373)e of st(cid:396)u(cid:272)tu(cid:396)e(cid:859)s type. Member names are identifiers declared in the braces. Structure definition should be placed outside any function definition: makes the structure type available to all code that follows the structure definition. To declare two variables of type cdaccount: cdaccount my_account, your_account; My_account and you_account both contain the member variables described in the structure definition. Structure value consists of all the values of member variables. Member variables are specific to the structure variable in which they are declared.