CMPSC 32 Chapter Notes - Chapter 10: Information Hiding, Member Variable, Default Constructor
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;