[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 wrote:
<snip>
> >int lookupChar(const char *str, char c)
> >{
> >  char *p;
> >  int i;
> >
> >  for (p = str, i = 0; *p != '\0'; *p++, i++)
> >  {
> >    if (*p == c)
> >      return i;
> >  }
> >
> >  return -1;
> >}
> 
>   assignmenten: *p++ virker kun på grund af at hvad du har puttet ind i den
> pointer to char incrementerer liniært, men vil ikke virke på alle
> compilers, at sige p++ derimod vil incrementere p til den næste hukummelses
> adresse af den type den er allocated til. Se måske "The C++ Programming
> language" omkring det. Det virker men er ikke tilrådeligt.

Argh, jeg vidste at nogen ville se det. Jeg burde have puttet den
obligatoriske disclaimer i bunden af denne besked; mailer code, du ved
nok. Ja, jeg saa ogsaa dette lige efter at jeg havde sendt den, men
syntes ikke at det var noedvendigt med en rettelse da jeg regner med at
folkene paa listen ved hvad de laver.

>   Med Venlig Hilsen
>   Kim Pedersen

-- 
| Per Vognsen (Randers - Denmark)| "Superstition is a  word the |
| Mail: <sslug@sslug>   | ignorant  use   to  describe |
| Voice: +45 20639009            | their own ignorance." - Sifu |


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