Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Error - but I can't find it!!
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Dan_




PostPosted: Thu Oct 05, 2006 2:13 pm   Post subject: Error - but I can't find it!!

I'm using DevC++ to write this and I have to write it in C. My problem is when I try to compile I get a red line that the very top of my code, and it's red, not the maroon red, and then it says on line 28 I have a syntax error before the { token - this line is maroon. I am a beginning programmer and am working through this program doing the basic parts first, therefore my code is not entirely complete, but from the functions I have there now, it should be able to compile. If you could help me find the error(s) I'd greatly appreciate it! The code is attached as the text doc.

Thanks.



error.txt
 Description:
The code that's giving me an error.

Download
 Filename:  error.txt
 Filesize:  1.87 KB
 Downloaded:  124 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Thu Oct 05, 2006 5:07 pm   Post subject: (No subject)

There are many, many problems with this code. The Hungarian notation and extraneous commenting are big problems.

However, your program would compile but for two things, as far as I can see, without actually trying to compile it myself.

So... anyway... the error it's telling you about is on line 28. What is on line 28?
md




PostPosted: Thu Oct 05, 2006 5:15 pm   Post subject: (No subject)

I count four errors, and all of them are exactly the same; they probably aren't the same one's wtd found though. I too have not tried compiling it.

It'd be best if you post the actual error the compiler gives you, not the color your IDE highlights the line in. If you read the compiler's error message it'll probably tell you exactly what's wrong Wink
Dan_




PostPosted: Thu Oct 05, 2006 8:13 pm   Post subject: (No subject)

The excessive amount of commenting is because I lost points for not commenting enough on the last one. :\ And the error line it was giving me was: elseif (iInput == 2) {

I realize I needed it as else if*

Thanks guys, it's compiling now. Now I need to finish up the coding so it does what it needs to do! And I also added a ; after the abort()

Appreciate the help!
wtd




PostPosted: Thu Oct 05, 2006 10:52 pm   Post subject: (No subject)

Dan_ wrote:
The excessive amount of commenting is because I lost points for not commenting enough on the last one.


If those kinds of comments get you better scores, then your teacher loses major points for being a moron.

Comments should never be used to tell the person reading the code something the language itself tells them.
Tony




PostPosted: Thu Oct 05, 2006 11:10 pm   Post subject: (No subject)

commenting is used to tell why you are doing something, not what. The what part is the code itself.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: