[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] C++: Reference til medlemmer i object. *. eller ->



Torsdag den 14. april 2005 14:17 skrev Michael Rasmussen:
> Hej alle,
>
> Jeg har spekuleret over, hvad der mest korrekt i OOP sammenhæng når man
> skal referere til et objekts medlemmer; både ud fra en teoretisk/praktisk
> tilgang (praktisk=performance/brug af hukommelse).
>
> klasse.medlem (objekt gemmes på stakken)
> klasse test;
>
> test.medlem;
>
> klasse->med (objekt oprettes dynamisk i hip)
> klasse *test;
>
> klasse test = new klasse();

Er klasse en klasse eller en peger?

> test->medlem;
> delete(test);
>
> Hvad har i af kommentarer/holdninger til ovenstående?

Jeg har læst det tre gange og kan ikke få dit eksempel til at give nogen 
mening.

>
> Min egen mening er, at dynamisk er mere i OOP's ånd, og derfor, ud fra en
> teoretisk tilgang, bør foretrækkes.

Den slags generaliseringer kan du slet ikke lave.

Mads

-- 
Mads Bondo Dydensborg


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *