FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » An overloading question
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: An overloading question [message #174498 is a reply to message #174497] Wed, 15 June 2011 01:58 Go to previous messageGo to previous message
sheldonlg is currently offline  sheldonlg
Messages: 166
Registered: September 2010
Karma:
Senior Member
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.

Now here is the really weird thing. I decided to experiment with a
simplified example and so copied the entire files into a test area via a
copy/paste. 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 and not
do any other work. 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.

I expected the same result as the I had been getting. However, what
happened was that the output was from the overloaded method, not the
base method.

Now I am totally baffled.

--
Shelly
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: check user log and redirect
Next Topic: use GET in include
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 20:07:58 GMT 2024

Total time taken to generate the page: 0.04219 seconds