Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Here's a good one...
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Keith Thompson, post: 1713339"] That's good advice for beginners, and it certainly applies to the OP's code. The more advanced version is: Always look at the earliest diagnostic reported by the compiler. Anything following a syntax error can probably be ignored; typical C compilers don't recover well from syntax errors. But semantic errors (type mismatches, etc.) typically don't cause the same kind of cascades that syntax errors do. The very first error message you see is almost certainly meaningful. Error messages up to and including the first reported syntax error are likely to be meaningful, but don't spend too much time on them; if you can't figure out the error, fix the first one (or the first N) and recompile. Error messages following a syntax error are likely to be meaningless cascade errors. Errors involving typedef names often behave like syntax errors (since a typedef name is effectively a keyword in most contexts). Having said all that, fixing each error one at a time and recompiling for each fix isn't an unreasonable approach. (I usually try to fix as many errors as I can, because I typically build large software packages with multiple levels of auto-configuration and Makefiles; re-running a single compilation isn't always practical, and the entire build can take hours. A novice isn't likely to be in that situation.) [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Here's a good one...
Top