CMPSC 32 Chapter Notes - Chapter 10: Information Hiding, Member Variable, Default Constructor

56 views4 pages
10 Apr 2017
School
Course
Professor

Document Summary

Problem solving with c++ - chapter 10: defining classes. Describes what kinds of values the variables can hold. Structure = an object without any member functions struct structure_tag { Keyword struct announces that this is a structure definition. Member names = identifiers declared inside the braces. Definition is usually placed outside any function definition. There is one member value for each member name declared in the structure definition. Member variables = store the member values that make up the structure value. Specified by giving the name of the structure followed by a dot, then the member name. Dot operator = used to specify a member variable of a structure variable. You can assign structure values using the equal sign. The following are equivalent: apples = oranges; apples. quantity = oranges. quantity; apples. size = oranges. size; A structure definition can also be used to declare structure variables struct weatherdata { double temperature; double wind_velocity;

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents