Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/06/08 13:19
Read: times


 
#156426 - more careful with decrement unsigned char
Responding to: ???'s previous message
for (i = (array_size - 1); i >= 0; i--)

This will loop as long 'i' is greater or equal zero.
Because 'i' is 'unsigned char' not 'signed char' the value 0
decrements to 255 (not -1). This is an endless loop.



List of 9 messages in thread
TopicAuthorDate
Compile error using a bubble sort            01/01/70 00:00      
   Is the array 'uchar' or is it 'int'? Do not mix.            01/01/70 00:00      
   argument consistency            01/01/70 00:00      
      I had one error and type mismatch seen            01/01/70 00:00      
         more careful with decrement unsigned char            01/01/70 00:00      
         Use different identifiers for global and auto            01/01/70 00:00      
            Yes I saw the corruption...            01/01/70 00:00      
               You can use any type you like.            01/01/70 00:00      
                  thanks guys....            01/01/70 00:00      

Back to Subject List