[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 ->



On Thu, 14 Apr 2005 22:54:15 +0200 Michael Rasmussen wrote:

>> Jeg har læst det tre gange og kan ikke få dit eksempel til at give nogen
>> mening.
>> 
> Jamen, så må jeg jo tydeliggøre det:-)

> med klasse:
> HelloWorld hw;
> if (hw.HelloWorld__sayHello("Donald", r) == SOAP_OK)

> med peger:

> hw = new HelloWorld;
> if (hw->HelloWorld__sayHello("Donald", r) == SOAP_OK)

Personligt bruger jeg den tommelfingerregel, at jeg bruger pointere, når
det giver en fordel. For eksempel tilstræber jeg at have funktionen:

f(Klasse *x)

hvis x kan pege på 0 og ellers

f(const Klasse &x)


I dit eksempel ville jeg ikke bruge en pointer, da det ingen fordele
giver, men en del ekstra besvær.

-- 
41 6E 64 65 72 73 


 
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] *