Click here to Skip to main content
15,920,031 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: List Control Selection Pin
ThatsAlok11-Mar-05 2:01
ThatsAlok11-Mar-05 2:01 
GeneralRe: List Control Selection Pin
RichardS11-Mar-05 3:26
RichardS11-Mar-05 3:26 
GeneralRe: List Control Selection Pin
Ravi Bhavnani11-Mar-05 4:30
professionalRavi Bhavnani11-Mar-05 4:30 
GeneralRe: List Control Selection Pin
ThatsAlok11-Mar-05 19:36
ThatsAlok11-Mar-05 19:36 
GeneralC++ HELL : Object Addresses Pin
vikramlinux11-Mar-05 0:18
vikramlinux11-Mar-05 0:18 
GeneralRe: C++ HELL : Object Addresses Pin
RichardS11-Mar-05 1:09
RichardS11-Mar-05 1:09 
GeneralRe: C++ HELL : Object Addresses Pin
vikramlinux11-Mar-05 1:15
vikramlinux11-Mar-05 1:15 
GeneralRe: C++ HELL : Object Addresses Pin
RichardS11-Mar-05 3:34
RichardS11-Mar-05 3:34 
You are quite right but you missed one thing. You have not created different data members. What you have done is to create each instance of the class with the same data member. Thus the compiler just allocs the same memory place for it. Think of it like what a union does.

The data is there in all cases (base1::data0, base2::data0 and derived::data0 will be all valid calls) the compiler has just seen that the same data member is inherited and thus the same memory can be used. In the first eg this is no ambiguity between the where to locate the memory. In the second one there is, so two locations are located (the first inherited object will line up with the derived class).

Rich


"Programming today is a race between software engineers striving to build bigger and
better idiot-proff programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
GeneralRe: C++ HELL : Object Addresses Pin
jan larsen11-Mar-05 1:14
jan larsen11-Mar-05 1:14 
GeneralRe: C++ HELL : Object Addresses Pin
vikramlinux11-Mar-05 1:20
vikramlinux11-Mar-05 1:20 
GeneralRe: C++ HELL : Object Addresses Pin
jan larsen13-Mar-05 22:13
jan larsen13-Mar-05 22:13 
GeneralRe: C++ HELL : Object Addresses Pin
vikramlinux13-Mar-05 22:16
vikramlinux13-Mar-05 22:16 
GeneralRe: C++ HELL : Object Addresses Pin
TheGreatAndPowerfulOz11-Mar-05 16:27
TheGreatAndPowerfulOz11-Mar-05 16:27 
GeneralRe: C++ HELL : Object Addresses Pin
jan larsen13-Mar-05 22:16
jan larsen13-Mar-05 22:16 
Generalwindows.h / MessageBox Pin
doneirik11-Mar-05 0:15
doneirik11-Mar-05 0:15 
GeneralRe: windows.h / MessageBox Pin
vikramlinux11-Mar-05 0:53
vikramlinux11-Mar-05 0:53 
GeneralRe: windows.h / MessageBox Pin
Mike Dimmick11-Mar-05 2:21
Mike Dimmick11-Mar-05 2:21 
GeneralProperty headache Pin
Lord Phoenix10-Mar-05 23:06
Lord Phoenix10-Mar-05 23:06 
GeneralRe: Property headache Pin
Mircea Puiu11-Mar-05 4:27
Mircea Puiu11-Mar-05 4:27 
GeneralRe: Property headache Pin
Lord Phoenix11-Mar-05 5:26
Lord Phoenix11-Mar-05 5:26 
GeneralRe: Property headache Pin
includeh1011-Mar-05 4:32
includeh1011-Mar-05 4:32 
GeneralRe: Property headache Pin
Lord Phoenix11-Mar-05 5:27
Lord Phoenix11-Mar-05 5:27 
GeneralMDI Document with data from UDP Pin
schultz.tom10-Mar-05 22:54
schultz.tom10-Mar-05 22:54 
GeneralRe: MDI Document with data from UDP Pin
Neville Franks11-Mar-05 2:56
Neville Franks11-Mar-05 2:56 
GeneralRe: MDI Document with data from UDP Pin
schultz.tom11-Mar-05 8:42
schultz.tom11-Mar-05 8:42 

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.