I am not asking what it will do, that is a simple experimnt that I can do myself. Does anyone have specific knowledge of whether the following for loop where WFLcnt is an unsigned char is specified in the ANSI C standard to run 0 or 256 times.
for ( WFLcnt = 0 ; WFLcnt !=0 ; WFLcnt++) { ..... }
"I am not asking what it will do, that is a simple experimnt that I can do myself. Does anyone have specific knowledge of whether the following for loop where WFLcnt is an unsigned char is specified in the ANSI C standard to run 0 or 256 times." The simple answer to your question is that the ANSI standard guarantees that the loop will run zero times. Whether you use an unsigned char or a short is irrelevant. I'd advise you to get hold of a decent 'C' book before going any further. If you don't get a good grasp on the basics of 'C' early on you'll run in to all sorts of unexpected traps.
Note that the ANSI standard does not specify that a char shall be 8 bits! The ANSI standard requires that a char have at least 8 bits, and that the limits.h file provided by the implementation shalll define CHAR_MAX accordingly.
View all questions in Keil forum