[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: [CPROG] C vs. C++ problem



Jan Eggert Kofoed <sslug@sslug> skrev:

> Bortset fra at jeg er helt enig i, at globale variable skal
> undgås, hvor det er muligt, men når Sune nu spørger,
> så svarer vi selvfølgelig.

Jeps - men et svar kan så sandelig også være at påpege, at den brugte
metode er uheldig. Og jeg havde da også givet forklaringen med
"extern" hvis den ikke allerede var nævnt, før jeg svarede.


Jan Eggert Kofoed <sslug@sslug> skrev:

> Som du skriver, så er struct blot en klasse, hvor alt er
> tilgængeligt for alle.  Men det er ikke korrekt, at det kun er en
> samling af data, idet en C++ struct også kan have metoder!

Ja; men struct sender _signaler_ om, at det ikke er en egentlig
klasse, men snarere en C-agtig samling af data. Det står naturligvis
enhver frit for at sende de forkerte signaler :-). En gennemskuelig
sovs er dog nu om dage det måske vigtigste krav til en programmør;
tid&plads hensyn har hardware udviklingen i stor grad gjort til mindre
problemer. Og gennemskuelige programmer giver alt andet lige færre
fejl.

-- 
Regards, Anders                         If a Microsoft product
(address is valid)                      fails, who do you sue?


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 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] *