[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] pointer gymnastik



Kim Pedersen <sslug@sslug> skrev:

> >*p++ forøger p og returnerer det, den pegede på

>  forkert, *p++ forøger ikke p, men prøver at forøge det p peger på,
>  men som er den næste karakter.

*p++ betyder *(p++) - hvis det betød (*p)++ således at det, p peger på
blev forøget, ville løkken ikke terminere ved slutningen af strengen.
I stedet ville den terminere når det første tegn i strengen var blevet
så stort, at det havde lavet overflow, så det blev småt og dernæst var
nået op på værdien nul.

Jeg kan ikke længere huske hvad løkken gjorde, men jeg tvivler på, at
den havde fungeret hvis *p++ virkelig havde forøget det, p peger på.


>  fuldt ud lovligt, kommer jo simpelthen an på hvad for en computer
> compileren er skrevet til

Det her vil jeg helst ikke diskutere mere, da jeg ikke er på sikker
grund med, hvad der gælder.

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