![]() |
|
#1
|
|||
|
|||
hi, guys. i'm a supernovice for c++. i have a Q to askcan anyone tell me what's wrong with my code?
why did my computer report 32 errors for this simple program???!!!~~~~ thx guys CPP / C++ / C Code:
Last edited by LuciWiz : 13-Jan-2007 at 05:55.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|
#2
|
|||
|
|||
Re: hi, guys. i'm a supernovice for c++. i have a Q to askQuote:
Well, how many errors did you expect? One of my compilers gave 26 errors, and one gave 22, so I guess that yours wins. However, your other question makes a little more sense: Quote:
Seriously: In general I think you should post the errors that you saw, since different compilers give different kinds of messages and, in order to help us help you, it is sometimes useful to go over them with you step by step. (So that next time you might be able to figure them out more quickly.) If there are numerous errors that are "almost the same" as others except for line numbers, just post the first few messages. Also, tell us what compiler you are using. Visual C++ version 6 has a number of bugs that cause erroneous error messages that don't appear in Visual C++ 2005, so sometimes it makes a difference to people who are trying to help. In this case, I am guessing that you might have seen things like this: Code:
This is for line number eight in my copy of your code, and similar messages appeared for the next nine or ten lines. The messages themselves probably don't mean much to you, so I'm not surprised that you need a little help. (Sometimes the error messages are pretty clear, and sometimes not --- as in this case.) Here's the thing: In C and in C++, assignment statements must be inside a function. Your program has one function: the main(). So put the assignment statements inside main() I suggest that you put all of your declarations inside [kbd]main()[/also]. Then you can get to the next step in debugging your program. If you still get messages that you don't understand then post them. Regards, Dave |
|
#3
|
|||
|
|||
Re: hi, guys. i'm a supernovice for c++. i have a Q to askHi,
Every excutable code must be in any one of the functions . regards dhawan |
Recent GIDBlog
Python ebook by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| + Hey Guys | EthicsD | New Member Introductions | 0 | 10-Oct-2006 10:39 |
| Newbie Problems. Help me guys | the_last_rites | Apache Web Server Forum | 4 | 18-Jan-2005 11:57 |
| Hi guys pls help me | coolraghav | Web Hosting Forum | 9 | 21-May-2004 06:23 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The