Click here to Skip to main content
15,897,315 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: dynamic class instantiation in c++? Pin
Giles28-Jul-05 7:04
Giles28-Jul-05 7:04 
GeneralRe: dynamic class instantiation in c++? Pin
ThinkingPrometheus2-Aug-05 2:37
ThinkingPrometheus2-Aug-05 2:37 
GeneralCListView usage Pin
B.R.Singh28-Jul-05 1:19
B.R.Singh28-Jul-05 1:19 
GeneralRe: CListView usage Pin
Mohammed F. Salem28-Jul-05 4:26
Mohammed F. Salem28-Jul-05 4:26 
GeneralRe: CListView usage Pin
David Crow28-Jul-05 5:11
David Crow28-Jul-05 5:11 
General,CListView Usage Pin
B.R.Singh28-Jul-05 1:14
B.R.Singh28-Jul-05 1:14 
GeneralLooking for an advice about password authentication Pin
Halawlaws28-Jul-05 1:07
Halawlaws28-Jul-05 1:07 
GeneralRe: Looking for an advice about password authentication Pin
mark novak28-Jul-05 4:45
mark novak28-Jul-05 4:45 
QuestionIs there a #define for Multi-Threading? Pin
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX28-Jul-05 1:02
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX28-Jul-05 1:02 
AnswerRe: Is there a #define for Multi-Threading? Pin
berndg28-Jul-05 2:15
berndg28-Jul-05 2:15 
GeneralRe: Is there a #define for Multi-Threading? Pin
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX28-Jul-05 4:21
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX28-Jul-05 4:21 
GeneralRe: Is there a #define for Multi-Threading? Pin
berndg28-Jul-05 4:27
berndg28-Jul-05 4:27 
AnswerRe: Is there a #define for Multi-Threading? Pin
Blake Miller28-Jul-05 5:09
Blake Miller28-Jul-05 5:09 
GeneralRe: Is there a #define for Multi-Threading? Pin
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX28-Jul-05 5:19
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX28-Jul-05 5:19 
AnswerRe: Is there a #define for Multi-Threading? Pin
Bob Stanneveld28-Jul-05 5:22
Bob Stanneveld28-Jul-05 5:22 
AnswerRe: Is there a #define for Multi-Threading? Pin
Alexander M.,28-Jul-05 8:53
Alexander M.,28-Jul-05 8:53 
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 

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.