CMPSC 16 Lecture Notes - Lecture 17: Type Qualifier, Member Variable

28 views6 pages
1 Dec 2016
School
Course
Professor

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents