delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/06/03:53:11

Date: Mon, 6 Apr 1998 09:48:46 +0200 (MET DST)
From: Miguel Murillo <mmurillo AT ideafix DOT litec DOT csic DOT es>
To: Erik Max Francis <max AT alcyone DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: For loop problem
In-Reply-To: <35280CBF.FA7634A@alcyone.com>
Message-ID: <Pine.LNX.3.95.980406094717.26613A-100000@ideafix.litec.csic.es>
MIME-Version: 1.0

> > unsigned char index = 0;
> > unsigned char array[256];
> > for (index = 0; index < 256; index++)
> >         array[index] = index;

> Iterate with something other than a char.  An unsigned char can hold
> values between 0 and 255 inclusive, so these conditions will _always_ be
> satisfied.
Yes, It's well

> 
>     int index;
> 
>     for (index = 0; index < 256; index++)
>         ...

    unsigned char index = 0; 
    unsigned char array[256];
    for (index = 0; index <= 255; index++)
          array[index] = index;   

It's very well.

				Miguel Murillo

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019