Click here to Skip to main content
15,921,577 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Outlook API. Where to find it??? Pin
Mike Beckerleg2-Jul-04 0:19
Mike Beckerleg2-Jul-04 0:19 
AnswerRe: Outlook API. Where to find it??? Pin
BlackDice2-Jul-04 2:56
BlackDice2-Jul-04 2:56 
GeneralRe: Outlook API. Where to find it??? Pin
anderslundsgard11-Jul-04 21:31
anderslundsgard11-Jul-04 21:31 
GeneralRe: Outlook API. Where to find it??? Pin
BlackDice12-Jul-04 2:57
BlackDice12-Jul-04 2:57 
GeneralRe: Outlook API. Where to find it??? Pin
anderslundsgard12-Jul-04 3:12
anderslundsgard12-Jul-04 3:12 
Questionwhere to do the query? Pin
JabraJabra1-Jul-04 22:15
JabraJabra1-Jul-04 22:15 
AnswerRe: where to do the query? Pin
RChin2-Jul-04 0:21
RChin2-Jul-04 0:21 
GeneralPolymorphism in C++ Pin
gutsyfarid1-Jul-04 21:27
gutsyfarid1-Jul-04 21:27 
PROBLEM
Unable to understand the variation in size of object
All the code is tested under Borland C++ ver 3.1
In borland V3.1 the int takes two bytes
Lets look at the following code

Class base<br />
{<br />
	public:<br />
		int b;<br />
		base()<br />
{}<br />
		virtual void f() {}<br />
		virtual void g() {}<br />
};<br />
Class derive : virtual public base<br />
{<br />
	public:<br />
		int d;<br />
		derive()<br />
		{}<br />
		virtual void f() {}<br />
		virtual void g() {}<br />
};

………………
derive d;
cout<<sizeof(d); <b="">gives 12 why?
/*
But if I don’t give constructors in derive then the size of derive class object is 10, because there will be no 2 bytes extra in object layout as shown below. Please help me out about finding the myth of these extra two bytes.
*/

Object-Layout            V-TABLE
   |------------|          |------------|
---|ptr to base |       -->|derive::f   |
|  |------------|       |  |------------|
|  |derive v-ptr|-------|  |derive::k   |
|  |------------|          |------------|
|  |d           |        ->|derive::f   |
|  |------------|        | |------------|
|  |0           |<--     | |base::g     |
|  |------------|   |    | |------------|
-->|base-vptr   |---|----|
   |------------|   |
   |b           |   |
   |------------|   |<small>what the hell is this</small>



Please reply at:
Contact: informfarid@yahoo.com


------------------------------------------------------------
In the middle of dificulty lies oppurtunity.
GeneralRe: Polymorphism in C++ Pin
Johnny ²2-Jul-04 2:20
Johnny ²2-Jul-04 2:20 
GeneralRe: Polymorphism in C++ Pin
mfareed_baig2-Jul-04 2:58
mfareed_baig2-Jul-04 2:58 
GeneralRe: Polymorphism in C++ Pin
Johan Rosengren2-Jul-04 6:43
Johan Rosengren2-Jul-04 6:43 
GeneralRe: Polymorphism in C++ Pin
Paul Ranson2-Jul-04 3:28
Paul Ranson2-Jul-04 3:28 
GeneralRe: Polymorphism in C++ Pin
Blake Miller2-Jul-04 7:55
Blake Miller2-Jul-04 7:55 
Generalgetting quota (space) for an logged-in user in FTP Pin
harinat1-Jul-04 21:25
harinat1-Jul-04 21:25 
GeneralRe: getting quota (space) for an logged-in user in FTP Pin
Ted Ferenc1-Jul-04 21:45
Ted Ferenc1-Jul-04 21:45 
GeneralRe: getting quota (space) for an logged-in user in FTP Pin
harinat1-Jul-04 22:17
harinat1-Jul-04 22:17 
GeneralRe: getting quota (space) for an logged-in user in FTP Pin
Ted Ferenc1-Jul-04 23:00
Ted Ferenc1-Jul-04 23:00 
QuestionHow to add functionality on 'OK' button on a property sheet? Pin
Rajesh_K_Sharma1-Jul-04 21:21
Rajesh_K_Sharma1-Jul-04 21:21 
AnswerRe: How to add functionality on 'OK' button on a property sheet? Pin
Antony M Kancidrowski2-Jul-04 1:58
Antony M Kancidrowski2-Jul-04 1:58 
AnswerRe: How to add functionality on 'OK' button on a property sheet? Pin
PJ Arends2-Jul-04 17:55
professionalPJ Arends2-Jul-04 17:55 
GeneralData base Question ( VC++ and ACCESS) Pin
Anonymous1-Jul-04 20:43
Anonymous1-Jul-04 20:43 
GeneralRe: Data base Question ( VC++ and ACCESS) Pin
RChin2-Jul-04 0:36
RChin2-Jul-04 0:36 
QuestionHow to change Menu caption dynamically? Pin
uus991-Jul-04 20:37
uus991-Jul-04 20:37 
AnswerRe: How to change Menu caption dynamically? Pin
bneacetp1-Jul-04 20:53
bneacetp1-Jul-04 20:53 
GeneralRe: How to change Menu caption dynamically? Pin
uus991-Jul-04 21:13
uus991-Jul-04 21:13 

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.