Re: [Dev-C++] Virtual Functions and Command system
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2003-08-24 22:22:51
|
#1 Is this a question or a statement?
#2 "I am being told..." as in a school assignment? What about googling
about the specific term, or maybe oogling through some reference
litterature?
/Per W
On Sun, 24 Aug 2003, David McKen wrote:
> #1
> Assume the following definitions:
>
> class A {
> public:
> virtual void do_xxx(void)
> {
> //code
> }
> }
>
> class A_derivative : public A
> {
> void do_xxx(void)
> {
> //Some other code.
> }
> }
>
> Assume I have a object of type A_derivative.
>
> If I want the code for do_xxx to call do_xxx in class A first the only option I seem to have is add A::do_xxx() as the first line in A_derivative::do_xxx
>
> #2
> I have a command class which contains a string as the key and a function pointer as the data. I am being told about using "command objects" that would handle the actual execution of the command. Does anyone have any experience in this and if so could you give some example code or point me to a tutorial. The concept seems useful I am getting stuck when it comes to implementing it (Should I overload the () operator?)
>
> Thanks.
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
|