Click here to Skip to main content
15,913,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: 'type cast' : cannot convert from 'std::string' to 'char *' Pin
CPallini22-Apr-07 21:13
mveCPallini22-Apr-07 21:13 
GeneralRe: 'type cast' : cannot convert from 'std::string' to 'char *' Pin
prasad_som22-Apr-07 21:17
prasad_som22-Apr-07 21:17 
QuestionVirtual Tables Pin
ragavan22-Apr-07 20:03
ragavan22-Apr-07 20:03 
AnswerRe: Virtual Tables Pin
vibindia22-Apr-07 20:25
vibindia22-Apr-07 20:25 
GeneralRe: Virtual Tables Pin
ragavan22-Apr-07 20:54
ragavan22-Apr-07 20:54 
GeneralRe: Virtual Tables Pin
Sarath C22-Apr-07 20:59
Sarath C22-Apr-07 20:59 
GeneralRe: Virtual Tables Pin
Arman S.22-Apr-07 21:04
Arman S.22-Apr-07 21:04 
AnswerRe: Virtual Tables Pin
cmk22-Apr-07 21:01
cmk22-Apr-07 21:01 
Two VTables are created, one for A, one for B.

The same VTable is used for all instances of a class, i.e. all instances of A use the A VTable, all instances of B use the B VTable.

The A VTable will have 1 entry: A::display
The B VTable will have 2 entries: B::display, B:print

Once a method is declared virtual the same function signature is virtual in all derived class' regardless of whether the virtual keyword is used.

In Visual studio the VTable is called __vfptr in the debugger 'Locals' and 'Watch' views.
The debugger may not show all entries, but you can use the address in a memory window and look at see the list of function address' (null terminated list).

[EDIT]
Each instance of an class that has a VTable will start with a pointer to that VTable, but from a developer point of view the start of the object is the first developer defined member.
[/EDIT]



...cmk

Save the whales - collect the whole set

AnswerRe: Virtual Tables Pin
Hamid_RT25-Apr-07 7:38
Hamid_RT25-Apr-07 7:38 
QuestionError C2061: syntax error : identifier 'StdDDECallback' Pin
Pankaj.Jain22-Apr-07 19:26
professionalPankaj.Jain22-Apr-07 19:26 
AnswerRe: Error C2061: syntax error : identifier 'StdDDECallback' Pin
prasad_som22-Apr-07 19:47
prasad_som22-Apr-07 19:47 
AnswerRe: Error C2061: syntax error : identifier 'StdDDECallback' Pin
Karismatic22-Apr-07 19:48
Karismatic22-Apr-07 19:48 
Questioncode standardise Pin
deeps_cute22-Apr-07 17:31
deeps_cute22-Apr-07 17:31 
AnswerRe: code standardise Pin
_AnsHUMAN_ 22-Apr-07 18:40
_AnsHUMAN_ 22-Apr-07 18:40 
GeneralRe: code standardise Pin
deeps_cute22-Apr-07 19:50
deeps_cute22-Apr-07 19:50 
GeneralRe: code standardise Pin
_AnsHUMAN_ 22-Apr-07 20:40
_AnsHUMAN_ 22-Apr-07 20:40 
GeneralRe: code standardise Pin
jeron123-Apr-07 7:08
jeron123-Apr-07 7:08 
QuestionDAO database Pin
dec8222-Apr-07 17:09
dec8222-Apr-07 17:09 
AnswerRe: DAO database Pin
Mark Salsbery23-Apr-07 6:37
Mark Salsbery23-Apr-07 6:37 
Questionerror C2440 Pin
Aint22-Apr-07 16:45
Aint22-Apr-07 16:45 
AnswerRe: error C2440 Pin
David Crow22-Apr-07 17:03
David Crow22-Apr-07 17:03 
GeneralRe: error C2440 Pin
Aint22-Apr-07 17:43
Aint22-Apr-07 17:43 
GeneralRe: error C2440 Pin
David Crow23-Apr-07 3:11
David Crow23-Apr-07 3:11 
AnswerRe: error C2440 Pin
vibindia22-Apr-07 18:03
vibindia22-Apr-07 18:03 
GeneralRe: error C2440 Pin
Aint22-Apr-07 18:30
Aint22-Apr-07 18:30 

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.