[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] Dynamisk alloceret arrays




--- Per Vognsen <sslug@sslug> wrote:
> Thomas M. wrote:
> [snip]
> >  Er der en mulighed for at lave dynamisk
> allocerede arrays, således at de
> > kan vokse, når der bliver brug for det?

Det kan lade sig gøre som omtalt i de andre indlæg, men det er min
erfaring at den slags koster tid. Hvis det er noget der skal gøres
meget ofte, fx inde i en loop, vil jeg kraftigt anbefale at du finder
en anden løsning. Eksempelvis prøver at estimere den maksimale
størrelse på arrayet funktionen får brug for, og malloc'er i
begyndelsen (og free'er i slutningen!).
Det er bedre at spilde en MB og så få et program der kører 10 fold
hurtigere efter min mening.

MVH. Sune

_____________________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com



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