I can't find this anywhere on the web. I've tried e-mailing Barbara
Moo, but my message is blocked. Can anyone tell me where I can find
it?
I'm confused by section 15.5.4. Is it possible to call Base::fcn()
through a pointer to D1? The text on p594 says this is not possible,
but the code on p595 says that this is OK.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
0
|
|
|
|
Reply
|
studennett (5)
|
8/24/2006 1:28:52 PM |
|
"studennett" wrote
> I can't find this anywhere on the web. I've tried e-mailing Barbara
> Moo, but my message is blocked. Can anyone tell me where I can find
> it?
>
> I'm confused by section 15.5.4. Is it possible to call Base::fcn()
> through a pointer to D1? The text on p594 says this is not possible,
> but the code on p595 says that this is OK.
class Base
{
public:
virtual int fcn();
};
class D1 : public Base
{
public:
int fcn(int);
};
Base::fcn() { std::cout << "Base" << std::endl; return 0; }
Derived::fcn(int) { std::cout << "Derived" << std::endl; return 1;}
void main()
{
D1 d;
Base *p1 = &d;
D1 *p2 = &d;
int i = p1->fcn(); //output: Base
int j = p2->fcn(2); //output: Derived
int k = p2->fcn(); // compiler error
// Error: function call [Derived.fcn()] does not match Derived::fcn(int)
}
I think 15.5.4 is saying it is not possible to call Base::fcn() from a
pointer to a D1 object when the pointer is of type D1*, but it is possible
when the pointer is of type Base*.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
0
|
|
|
|
Reply
|
Marlene
|
8/29/2006 3:37:40 PM
|
|
|
1 Replies
266 Views
(page loaded in 0.091 seconds)
Similiar Articles: Largest Collection Of Solutions Manuals & Test Banks Over The Net ...... 7th Edition, Sullivan, Test Bank Effective Leadership, 4th Edition ... Internet, 3rd Edition, Andrews, Beck, Test Bank IFRS Primer International GAAP Basics, 1st Edition ... Solutions Manual & Test Banks - comp.lang.java.programmer ...... Edition 2006, Weiss, Solutions Manual A First Book of ANSI C, 4th Edition ... 5th Edition, Karp, Test Bank Cengage Advantage Books: A Primer for Management, 2nd Edition ... Largest Collection Of Solutions Manuals & Test Banks Over The Net ...... Duckworth, Instructor Manual A First Book of ANSI C, 4th Edition ... Hilgenberg, Test Bank A History of Mathematics, 3rd Edition, Katz, Solutions Manual A Primer on ... Largest Collection Of Solutions Manuals & Test Banks Over The Net ...... McBride, Walrath, Test Bank Cultural Diversity in Health and Illness, 7th Edition, Spector, Test Bank Cultural Diversity: A Primer for the Human Services, 4th Edition ... Test Banks & Solutions Manual - comp.lang.java.programmer ...... Kc's Problems and Solutions for Microelectronic Circuits, 4th Edition, K, C, Smith ... 1st Edition, Joan Casteel, Test Bank Oracle 10g Programming: A Primer, 1st Edition ... ###$$Comprehensive Test Banks and solution manuals for student ...... Test Bank Computer Networking A Top-Down Approach 5E Kurose Solutions & Errata ... Solution Manual for Traffic and Highway Engineering by Garber and Hoel 4th Edition ... Largest Collection Of Solutions Manuals & Test Banks Over The Net ...... Champion, Instructor Manual Juvenile Justice System, 6th Edition, Champion, Test Bank Kc's Problems and Solutions for Microelectronic Circuits, 4th Edition, K, C ... Solutions Manual & Test Banks - comp.lang.java.programmer ...... 1st Edition, Carr, Solutions Manual Data Mining: A Tutorial Based Primer, 1st Edition ... Manual Financial and Management Accounting: An Introduction, 4th Edition ... All Solutions Manuals & Test Banks Are HERE !!! #5 - comp.unix ...... Planning, Implementing, and Evaluating Health Promotion Programs: A Primer, 5th Edition ... 2007, Pinto, Test Bank Project Management: The Managerial Process, 4th Edition ... Test Banks & Solutions Manual - comp.lang.java.programmer ...... Planning_Implementing_and Evaluating Health Promotion Programs: A Primer, 5th Edition ... Problems, 4th Edition, Macionis, Instructor Manual Social Problems, 4th Edition ... C++ Primer, 4th Edition | InformITC++ Primer, Fourth Edition, provides a comprehensive introduction to the C++ language. ... Errata. Download the errata Amazon.com: C Primer Plus (5th Edition) (0752063326961): Stephen ...In the fall of 2004, I used the fourth edition of "C Primer Plus" as the text for my class in introductory programming in C. Although I was not part of the decision to ... 7/20/2012 1:02:08 PM
|