CSC 4101 Chapter : OO Concepts

10 views4 pages
15 Mar 2019
School
Course
Professor

Document Summary

Objects struct s { int x; float y; S a; a. x = 42; a. y = 3. 14; S * q = new s; int i = p->x; int j = q->x; a: x = 42 y = 3. 14 p: q: Methods struct s { int x; float y; int getx() { return x; } S * p = new s; p->x = 42; p->y = 3. 14; int i = p->getx(); Constructors struct s { int x; float y; S * p = new s(42, 3. 14); int i = p->getx(); Visibility specifiers struct s { private: int x; float y; public: S(int a, float b) { x = a; y = b; } int getx() { return x; } S * p = new s(42, 3. 14); int i = p->getx(); int j = p->x; struct vs. class struct s { private: class s { public: class s { struct s {

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 Questions