home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 241,432 of 243,242   
   minforth to All   
   Re: the index of one array that can not    
   23 Oct 25 21:24:31   
   
   From: minforth@gmx.net   
      
   Am 23.10.2025 um 20:39 schrieb Rosario19:   
   >   
   >   
   > here the unsigned chars are 8 bit unsigned...   
   > here the index i it seems always definited from 0 to 255   
   > and so it is always definited a[i], but one can make errors the same   
   > in other places...   
   >   
   >   
   > #include    
   >   
   > main(void)   
   > {unsigned char a[258]="0123456789", i;   
   >   unsigned c;   
   >   for(c=i=0;c<500;++c,++i)   
   >       printf("%c",a[i]);   
   >   printf("\n");   
   >   return 0;   
   > }   
   >   
   > result   
   >   
   > C:\>index   
   > 0123456789   
   > 0123456789   
   >   
      
   Ada does it better ...   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca