Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > inheritance question

Reply
Thread Tools

inheritance question

 
 
JKop
Guest
Posts: n/a
 
      07-12-2004
hack_tick posted:

> hi there
> "Sharad Kala" <(E-Mail Removed)> wrote in

message
> news:(E-Mail Removed)...
> [...]
>> Template pattern.
>>
>> class A
>> {
>> public:
>> void f() {A::foo(); foo();} private:
>> virtual void foo(){cout << "Base foo";} };
>>
>>
>> class B : public A { protected:
>> void foo(){cout << "Derived foo";} };
>>
>> int main()
>> {
>> A* b = new B;
>> b->f();
>> delete b;
>> }

>
> thank you for your reply, one thing i didnt mentioned in

my previous
> post was class "A" is a SDK header file, so modifying it

is not the
> solution
>
> -regards,
> and once again thx for such a quick response



copy blah.h my_blah.h

edit my_blah.h

#include <my_blah.h>


-JKop
 
Reply With Quote
 
 
 
 
hack_tick
Guest
Posts: n/a
 
      07-12-2004
"JKop" <(E-Mail Removed)> wrote in message
news:ddvIc.4398$(E-Mail Removed)...
[..]
> copy blah.h my_blah.h
>
> edit my_blah.h
>
> #include <my_blah.h>





 
Reply With Quote
 
 
 
 
Richard Herring
Guest
Posts: n/a
 
      07-12-2004
In message <ddvIc.4398$(E-Mail Removed)>, JKop <(E-Mail Removed)>
writes
>copy blah.h my_blah.h
>
>edit my_blah.h
>
>#include <my_blah.h>
>

And remember to do it every time blah.h changes...

And don't forget to set some time aside to look for a new job.

--
Richard Herring
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ Struct inheritance against class inheritance johnsonlau C++ 1 07-21-2008 04:58 PM
Interface inheritance vs Implementation inheritance. Daniel Pitts Java 27 02-27-2008 01:37 AM
Private Inheritance and Publice Inheritance karthikbalaguru C++ 9 09-10-2007 01:05 PM
mul. inheritance & overloading operator new/delete solved by virtual base inheritance? cppsks C++ 0 10-27-2004 07:49 PM
Private access modifier and Inheritance (Inheritance implementation in Java) maxw_cc Java 1 12-21-2003 11:38 AM



Advertisments