Quote:
Originally Posted by Mr. Freeman
I can't find anything wrong with this line or any above it. I don't know why I'm getting a syntax error. Any help would be much appreciated.
|
In ANSI C, you have to declare all variables before executing any other code in a block. I can't be certain if this is your problem, but try moving the "static int counter = 0;" line above the printf and see if it compiles.
If that is indeed the problem, I would have hoped that C18 would have given a better error message. Sadly, C18 seems to do a poor job with errors in general from what I have seen.