Hi, I'm using mikroc for the first time, I'm using a for loop to access bits of a variable.
thus it creates an infinite loop
void sct80(long dat){
char c;
for (c = 23; c >= 0 ; c--){
if ((dat >> c)& 0x01) {
so the cycle works but my code goes backwards
void sct80(long dat){
char c;
for (c = 0; c >= 23 ; c++){
if ((dat >> c)& 0x01) {
the problem is that if I use a positive increment the cycle works but I need the for loop to count down from 23 to 0, and if I do so the for loop creates an infinite loop.