john@caeco.UUCP (11/05/87)
I have been looking at the source for Interviews. For those who don't know, Interviews is a toolkit for X, from Stanford, that is written in C++. I've run into some things that I can find in the C++ book. First, what does "protected" mean? Second, is "." an alternative for "::". Many thanks John Rigby utah-cs!caeco!john CAECO Inc. (801)255-8880 7090 South Union Park Avenue Midvale, UT 84047
john@caeco.UUCP (11/05/87)
> that is written in C++. I've run into some things that I can
That was supposed to be "can not".
Someday I might learn how to type.
steve@hpiacla.HP.COM (Steve Witten) (11/12/87)
"Protected" data is private to all functions except member functions of classes derived from the class containing the protected data. "." and "::" are substantially different. See pages 275-276 of THE BOOK for an explanation and example. =============================================================================== Steve Witten Industrial Applications Center {ucbvax, hplabs}!hpda!hpdsla!hpiacla!steve Hewlett-Packard Co. steve@hpiacla.HP.COM "Wot's...uh...the deal?"
bs@alice.UUCP (11/15/87)
In ye olden days . was used instead of :: in member function definitions: myclass.myfunction() { ... } A surprising amount of confusion arose from the fact that . here was used in the same way as :: was used in expressions. So it was changed: myclass::myfunction() { ... } and the confusion went away. This all happened before the book and before the release of the software. However, there was already quite a bit of code around so the dot notation was supported as an anachronism. See pg 311. Don't use it. It will eventually go away even in cfront. Newer compilers are unlikely to support anachonisms.