www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/05/18:46:34

From: Simz <tsim AT vegas DOT infi DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: For loop problem
Date: Sun, 05 Apr 1998 15:22:18 -0700
Organization: InfiNet
Lines: 20
Message-ID: <3528041A.36E2@vegas.infi.net>
References: <3527FEA6 DOT 54FA AT vegas DOT infi DOT net>
Reply-To: tsim AT vegas DOT infi DOT net
NNTP-Posting-Host: pm3-127.vegas.infi.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Simz wrote:
> 
> When ever I try to use a for loop in DJGPP with a char (or any type for
> that matter), the loop never stops when I try to loop to the max value
> that type can hold. For example
> 
> unsigned char index = 0;
> unsigned char array[256];
> for (index = 0; index < 256; index++)
>         array[index] = index;
> 
> This loop never stops, I've even tried..
> for (index = 0; index <= 255; index++)
> for (index = 0; index < 256; ++index)
> for (index = 0; index <= 255; ++index)
> 
> And I need all 256 iterations for my programs to work.
> Any sugestions?

 Besides using an integer.

- Raw text -


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