[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] hash two integers



sslug@sslug writes:

> Hvad gør jeg forkert?

Du ændre på ij og dermed free'er du en anden pointer end den du har
allokeret.


>   /*hash ascii array ij*/
>
>   while(*ij != 0){
>     h= (256*h+*ij++) % hashtable_length;
>
>   }

Derfor skal du gemme ij inden denne løkke, eller også skal du skrive
den om så du ikke ændre ij. 

>   free(ij) //medfører programmet krasher

-- 
 Peter Makholm     |         Perhaps that late-night surfing is not such a
 sslug@sslug |           waste of time after all: it is just the web
 http://hacking.dk |                                              dreaming
                   |                                    -- Tim Berners-Lee


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

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