Click here to Skip to main content
15,887,676 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionTool to generate API doc spec? Pin
huutribk200128-Jul-05 0:09
huutribk200128-Jul-05 0:09 
AnswerRe: Tool to generate API doc spec? Pin
mark novak28-Jul-05 0:30
mark novak28-Jul-05 0:30 
AnswerRe: Tool to generate API doc spec? Pin
Marc Soleda28-Jul-05 0:30
Marc Soleda28-Jul-05 0:30 
AnswerRe: Tool to generate API doc spec? Pin
Ravi Bhavnani28-Jul-05 1:37
professionalRavi Bhavnani28-Jul-05 1:37 
AnswerRe: Tool to generate API doc spec? Pin
huutribk200128-Jul-05 22:28
huutribk200128-Jul-05 22:28 
Generalc++ Pin
Nishad S28-Jul-05 0:03
Nishad S28-Jul-05 0:03 
GeneralRe: c++ Pin
Mohammed F. Salem28-Jul-05 0:12
Mohammed F. Salem28-Jul-05 0:12 
GeneralRe: c++ Pin
toxcct28-Jul-05 0:39
toxcct28-Jul-05 0:39 
the virtual C++ keywowrd tells that a member function is called instead of the base class' one.

for example, let's see this case :

<font color=blue>class</font> CBaseClass {
  <font color=blue>public</font>:
    <font color=blue>void</font> print() {
        printf(<font color=gray>"CBaseClass\n"</font>);
    }
};
 
<font color=blue>class</font> A : <font color=blue>public</font> CBaseClass {
  <font color=blue>public</font>:
    <font color=blue>void</font> print() {
        printf(<font color=gray>"A\n"</font>);
    }
};


now, if you make this :
CBaseClass* p = <font color=blue>new</font> A();
p->print();

this will display CBaseClass.

now, imagine you would like to access A::print() through a pointer to the base class, here come virtual.
if we had coded this instead :
<font color=blue>virtual void</font> print() { <font color=green>/*...*/</font> }

this would call the 'correct' print() function (as p is assigned with a A object, p->print() will call A::print(), even if p is a CBaseClass pointer).

understand better now ?




TOXCCT >>> GEII power
[toxcct][VisualCalc]
GeneralRe: c++ Pin
Ravi Bhavnani28-Jul-05 1:39
professionalRavi Bhavnani28-Jul-05 1:39 
GeneralRe: c++ Pin
David Crow28-Jul-05 5:16
David Crow28-Jul-05 5:16 
GeneralRe: c++ Pin
Alexander M.,28-Jul-05 9:09
Alexander M.,28-Jul-05 9:09 
GeneralVC Profiler Pin
RChin27-Jul-05 23:58
RChin27-Jul-05 23:58 
GeneralRe: VC Profiler Pin
Jack Puppy28-Jul-05 0:21
Jack Puppy28-Jul-05 0:21 
GeneralRe: VC Profiler Pin
RChin28-Jul-05 1:58
RChin28-Jul-05 1:58 
GeneralRe: VC Profiler Pin
Giles28-Jul-05 6:36
Giles28-Jul-05 6:36 
GeneralSearching for help on-line Pin
onlysaint27-Jul-05 23:54
onlysaint27-Jul-05 23:54 
GeneralRe: Searching for help on-line Pin
mark novak28-Jul-05 1:03
mark novak28-Jul-05 1:03 
GeneralProblems with Task Scheduler Pin
beedub27-Jul-05 23:21
beedub27-Jul-05 23:21 
GeneralRe: Problems with Task Scheduler Pin
mark novak28-Jul-05 0:46
mark novak28-Jul-05 0:46 
GeneralRe: Problems with Task Scheduler Pin
David Crow28-Jul-05 5:19
David Crow28-Jul-05 5:19 
GeneralRe: Problems with Task Scheduler Pin
beedub28-Jul-05 6:17
beedub28-Jul-05 6:17 
GeneralRe: Problems with Task Scheduler Pin
David Crow28-Jul-05 8:57
David Crow28-Jul-05 8:57 
QuestionHow to make a splitted frame? Pin
Olgun27-Jul-05 23:01
Olgun27-Jul-05 23:01 
AnswerRe: How to make a splitted frame? Pin
Mohammed F. Salem28-Jul-05 0:30
Mohammed F. Salem28-Jul-05 0:30 
GeneralRe: How to make a splitted frame? Pin
David Crow28-Jul-05 5:24
David Crow28-Jul-05 5:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.