I dont know; bloodshed wont run passed the second line its the new version; 4.9.8.0; its some crap; been trying to get on ircspy.com and download borland; but this dial-up crap is killing me.

:confused: Help me people

09-26-2003

Cat

1) Don't repost. We all saw your problem the first time.

2) Don't just post your code with 40-some mistakes and then expect people to fix it. If you want to pay me $35 an hour, with a minimum charge of 4 hours, I will debug your code. Otherwise, ask specific questions about specific errors, after researching the error yourself, and people will help you.

3) How the hell did you write code and end up with that many errors? Write small segments and compile, write small segments and compile, etc. Don't just throw the whole damn thing down and then try to debug it. Especially not when you're new to the language.

09-26-2003

HybridM

If it fails to compile on one (reputable) compiler with 40+ errors, it's not going to compile on Borland either.

09-26-2003

Killer Mike

Re:Superprogram

Sorrry for the repost; cant find a good compiler anywhere to download; but in any amount thanks for your help guys

09-26-2003

Cat

It's not the compiler's fault that your code is buggy. Fix the code, any compiler should be fine.

09-26-2003

DougDbug

Good advice!

Killer Mike,

Sorry, to reply without giving you any direct help. But, I'm at work, and I can only do this during "little breaks", and the computer that I'm at right now doesn't have a compiler, so I can't test-compile your code, and I can't test any specific suggestions either.

Although Cat is being hard on you, he/she is giving you really excellent advice.

Test Compile and test-run that. Add 1 or 2 lines of code and test-compile and test-run again, etc., etc., etc. When you write a function, write an empty function first, with a return line if the function is supposed to return something. At this point the function can return anything... Maybe "return 3 ;" That way, you can tell that your main function is calling the new function correctly.

If you develop your program this way, you will know where any errors are... in the last few lines of code that you added.

It is also useful to add extra cout statements during test/debug/development. You can display variables, results, return values, etc., to "see" what your program is doing.

One program I wrote has a bunch of if(Debug) cout... statements. When Debug == 0, the program runs normally. When I change Debug to 1, it displays all of the variables. This is quite common, but it's usually done with pre-compiler directives, so your "normal" exe file doesn't include all of the extra debug shtuff.

It takes some practice to learn to use these techniques. For example, you can't call a function that you haven't defined yet. You have to know what you can leave-out without adding errors. Once you learn to do this, programming gets a lot more fun! :) Or at least a lot less frustrating.

ALL programmers write programs this way. NOBODY writes an entire program and then test-compiles and test-runs. Of course, as you gain experience, you will be able to test less frequently. It is good practice to test each function you write before moving on to the next thing, no mater how experienced you are!

A WORD ON ERROR MESSAGES:
Compiler error messages can be misleading. Compilers are easily confused, and they don't know what you are trying to do. The first error message usually points to where the first error is... plus-or-minus one line. But, I've misplaced one little curly-brace, and the compiler reported hundreds of errors! This is really funny... when it happens to someone else! :)

Linker error messages can be worse, because you loose the line-number references during the compile process.

[EDIT
I just saw your other post. Please read the board hints & guidelines. There's some stuff in there about titles, cross-posting & bumping... it might prevent some future flaming! :D