Re: Object creation

From: EventHelix.com (eventhelix_at_gmail.com)
Date: 01/24/05


Date: 24 Jan 2005 05:07:02 -0800

I assume you are asking if A should be contained or referenced as a
pointer.

Directly adding "a" as a member variable makes the design simple as
you do not need to worry about allocating memory for a, it is allocated
within b.
The disadvantage here is that you have anybody using the class B has to
directly or indirectly include the header file containing class A.

Deepa

--
http://www.EventHelix.com/EventStudio
EventStudio 2.5 - Automate sequence diagram generation


Relevant Pages

  • Re: Thinking assembly?
    ... much more than to learn the few assembler memonics. ... And that in anyway is flawed in design, ... even once to use VirtualAlloc and didnt know anything about it. ... header...then I can esaly calculate the pointer. ...
    (alt.lang.asm)
  • Re: Pointer question
    ... Even referencing a bad pointer can be undefined behaviour. ... could imagine another hardware-checked architecture where constructing ... relationship with regards to new hardware design. ...
    (comp.lang.c)
  • Re: How to declare pointers to virtual base class methods ?
    ... Reconsider your design. ... Apart from compiler being unable to cast member ... > casting to the method pointer type of class A is necessary). ...
    (microsoft.public.vc.language)
  • Re: Implementing an interface
    ... pointer to pointer, which is supposed to contain the version number of ... I am not correctly allocating memory ... If the caller just expects a string with the version then you ...
    (comp.unix.programmer)
  • Re: Hash Map API Preference
    ... it returns a pointer to the stored ... the stored data is a design choice, ... CBF chose to have the table own the stored data, ... can do this, too, but only by using an intermediate "reference" ...
    (comp.lang.c)