August 2012
Intermediate to advanced
976 pages
30h 17m
English
Every class defines its own new scope. Outside the class scope, ordinary data and function members may be accessed only through an object, a reference, or a pointer using a member access operator (§ 4.6, p. 150). We access type members from the class using the scope operator . In either case, the name that follows the operator must be a member of the associated class.
Screen::pos ht = 24, wd = 80; // use the pos type defined by ScreenScreen scr(ht, wd, ' ');Screen *p = &scr;char c = scr.get(); // fetches the get member from the object scrc = p->get(); // fetches the get member from the object to which p points
Read now
Unlock full access