Click here to Skip to main content
16,010,268 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalstructures Pin
Anonymous8-Jul-04 23:38
Anonymous8-Jul-04 23:38 
GeneralRe: structures:::accessing structure of arrays through a class Pin
Anonymous9-Jul-04 0:49
Anonymous9-Jul-04 0:49 
GeneralRe: structures:::accessing structure of arrays through a class Pin
Maximilien9-Jul-04 0:56
Maximilien9-Jul-04 0:56 
GeneralRe: structures:::accessing structure of arrays through a class Pin
Johan Rosengren9-Jul-04 1:03
Johan Rosengren9-Jul-04 1:03 
GeneralRe: structures [modified] Pin
Antony M Kancidrowski9-Jul-04 1:12
Antony M Kancidrowski9-Jul-04 1:12 
GeneralRe: structures [modified] Pin
Anonymous9-Jul-04 1:21
Anonymous9-Jul-04 1:21 
GeneralRe: structures [modified] Pin
Maximilien9-Jul-04 1:28
Maximilien9-Jul-04 1:28 
GeneralRe: structures [modified] Pin
Antony M Kancidrowski9-Jul-04 2:28
Antony M Kancidrowski9-Jul-04 2:28 
Anonymous wrote:

.......<br />
Aclass *a = new Aclass;<br />
int x = a->count.days[0];<br />
.....



Since you create a new instance of Aclass in Bclass. This calls the constructor of Aclass. If Aclass constructor does not call the member function that initialised the data for days then it will contain uninitialised data.

You can either call the initialise member in the constructor of Aclass or change the Bclass code to call the initialise member function

.......<br />
Aclass *a = new Aclass;<br />
a->initialisefunction();   // name of the initialise member function<br />
int x = a->count.days[0];<br />
.....


IMO it is better to do the appropriate initialisation within Aclass.

Ant.

I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return!
- David Williams (Little Britain)

Generalcrystal reports alternatives Pin
Irish_GUI8-Jul-04 23:29
Irish_GUI8-Jul-04 23:29 
GeneralRe: crystal reports alternatives Pin
Antony M Kancidrowski9-Jul-04 6:02
Antony M Kancidrowski9-Jul-04 6:02 
Generaldiscussion point: pointers, memory allocations Pin
V.8-Jul-04 22:31
professionalV.8-Jul-04 22:31 
GeneralRe: discussion point: pointers, memory allocations Pin
Johan Rosengren9-Jul-04 1:07
Johan Rosengren9-Jul-04 1:07 
GeneralRe: discussion point: pointers, memory allocations Pin
palbano9-Jul-04 5:19
palbano9-Jul-04 5:19 
GeneralLearning C and getting an Errors on Compile! Pin
Cpach8-Jul-04 20:31
Cpach8-Jul-04 20:31 
GeneralRe: Learning C and getting an Errors on Compile! Pin
Egbro8-Jul-04 20:54
Egbro8-Jul-04 20:54 
GeneralRe: Learning C and getting an Errors on Compile! Pin
Cpach8-Jul-04 20:59
Cpach8-Jul-04 20:59 
GeneralRe: Learning C and getting an Errors on Compile! Pin
Antti Keskinen8-Jul-04 21:26
Antti Keskinen8-Jul-04 21:26 
GeneralRe: Learning C and getting an Errors on Compile! Pin
Cpach8-Jul-04 21:30
Cpach8-Jul-04 21:30 
GeneralRe: Learning C and getting an Errors on Compile! Pin
Egbro8-Jul-04 21:41
Egbro8-Jul-04 21:41 
GeneralRe: Learning C and getting an Errors on Compile! Pin
Cpach8-Jul-04 21:54
Cpach8-Jul-04 21:54 
QuestionHow can I display the word document in the textbox/rich text box Pin
sajithlal8-Jul-04 20:17
sajithlal8-Jul-04 20:17 
AnswerRe: How can I display the word document in the textbox/rich text box Pin
Johan Rosengren10-Jul-04 3:59
Johan Rosengren10-Jul-04 3:59 
GeneralCStatic Z-Order in dialog Pin
Mikey_E8-Jul-04 19:44
professionalMikey_E8-Jul-04 19:44 
GeneralRe: CStatic Z-Order in dialog Pin
Antti Keskinen8-Jul-04 21:41
Antti Keskinen8-Jul-04 21:41 
GeneralRe: CStatic Z-Order in dialog Pin
Mikey_E10-Jul-04 16:38
professionalMikey_E10-Jul-04 16:38 

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.