Re: An overloading question [message #174515 is a reply to message #174498] |
Wed, 15 June 2011 12:21 |
Thomas 'PointedEars'
Messages: 701 Registered: October 2010
Karma:
|
Senior Member |
|
|
sheldonlg wrote:
> On 6/14/2011 8:45 PM, Jerry Stuckle wrote:
>> Id you created it properly, then the constructor in B should be calling
>> b::y().
>>
>> I still suggest you have a mistake in your code.
>
> No, both constructors are there but are empty.
>
> […] I […] copied the entire files into a test area […]. I then eliminated
> all methods that were not called, eliminated all includes that were no
> longer needed in the classes, and modified the important routines to only
> do the printing and the one calling routine in the class to only call the
> prescribed method […]. So, besides the constructors (which were empty)
> the base class had two methods and the overload class had one (with the
> name as the final method invoked in the base class). The only typing I
> did was putting print statements in the final invoked methods to identify
> which one was doing the output.
>
> […] what happened was that the output was from the overloaded method, not
> the base method. […]
Talk is cheap. Show me the code.
-- Linus Torvalds (2000-08-25)
<http://www.catb.org/~esr/faqs/smart-questions.html#beprecise> ff.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
|
|
|