[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] malloc ter sig underligt



On Tue, 07 Sep 2004 12:00:02 +0200, Peter Makholm <sslug@sslug> wrote:
> Anders Søndergaard <sslug@sslug> writes:
> 

> Har du overvejet at koden egentlig ikke er ret læsevenlig? (Meget af
> det følgende er selvfølgelig i høj grad bare min mening)

Jah, det har du ret i. Jeg er ikke særlig skrap til det, jeg er lige begyndt.
Det skal nok forbedre sig, håber jeg :-) 
Jeg startede med programmering i C her i sommerferien, og dette er det første
egentlige program (ud over diverse demonstrationsprogrammer).

I må undskylde, det ser nok lidt rodet ud..

>Hvis realloc ikke har plads umidelbart efter det allerede allokerede
>hukommelse vil realloc begynde at flytte data og så returnere en
>pointer der peger et andet sted han.
>
>Men da du ikke kopierer den nye værdi af p tilbage fra find_numbers så
>ved den kaldende funktion ikke at du har flyttet data.

Det kan jeg da godt se, nu du siger det :-) 
Jeg skal lige have fat i det med ram pladser osv...

Nu mallocer jeg, kalder funktionen bag efter, kalder malloc og så
funktionen igen.
Det virker!
Tak skal du have!

Med venlig hilsen
Anders A Søndergaard


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