Hi.
Ive been programing for nearly five months now so I am not a noob but I cannot understand this;
for ( variable = 1 ; variable < 100 ; variable += 1 ) { // some code if ( foofar ) continue ; else sumfunc () ; } <endpre> if i continue does the variable get added?
The continue will jump to the closing brace of the for loop, so it will side-step any work you have inside the for body. But the expr3 (your increment) will be performed before expr2 is tested again to decide if a further iteration should be made.
If you don't have the language standard (paragraph 6.8.6.2) you can test this yourself. Remember that you can use the free MinGW Win32 compiler to write test applications on the PC. As long as you take care of the size of variables, you can debug a lot of algorithms on the PC before moving the code to the 8051 target.
By the way: You did write "strange problem", but didn't seem to tell what you find strange. What you see, and what you expected to see.
"Ive been programing for nearly five months now so I am not a noob."
I've been programming for more than 25 years, and I'm still a noob at some aspects of programming!
It's always useful to keep a good reference manual besides you when you work. My favourite is "C: A Reference Manual" by Harbison and Steele.
Just noticed that one of my colleagues has just nabbed mine!
Do you guys really have to scare poor aspiring programmers with heavyweights like "the standard" and H&S, when a clear answer can be found in K&R? ;)