[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] stream problemer



sslug@sslug wrote:
> Jeg har lidt svært at se berettigelsen af din funktion, da det jo er en
> stream du arbejder med.
Yeps. Men jeg ved ikke om det er en ofstream til en fil eller cout stream
jeg ønsker at udskrive til, det vælger brugeren. Jeg ønsker bare at
simpificere koden der tager sig af dette.

> Jeg vil anbefale en operator overload vha. friend funktioner.

Mit eksempel var simplificeret, det funktionen skal udskrive er op til
ca. 23 variabler, der ikke er samlet i noget fælles objekt, men i en
række vektorer og matricer. For at gøre det på en pæn måde skulle
et objekt O defineres der indeholdte variablerne og så en operator<< 
for objektet O. Men det er upraktisk pga. andre hensyn bland andet
memory.
 
> Jeg mener dog stadigvæk ikke du skal bruge en funktion til at
> udskrive det din pointer peger på det er ret meget ineffektivt.

Udskrivningen er en meget lille del af programmet, og resten kan tage
mellem få sekunder og uendeligt langt tid, så det er bare et spørgsmål
over overskuelig kode.

Men jeg har fået det til at virke med pointere, rent æstetisk er jeg dog 
ikke helt tilfreds, men tak til dig og andre for jeres kommentare.
-- 
  Mvh. Carsten Svaneborg


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

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