![]() |
|
#1
|
|||
|
|||
Two or more data types in declaration errorI keep getting the above error code when trying to execute to following source code:
CPP / C++ / C Code:
how can i fix this error, there are only doubles used in areacircle, areasquare, arearectangle. Last edited by LuciWiz : 23-Feb-2010 at 23:57.
Reason: Please insert your C++ code between [cpp] & [/cpp] tags
|
|||
|
#2
|
|||
|
|||
Re: Two or more data types in declaration errorno one?
bump |
|
#3
|
|||
|
|||
Re: Two or more data types in declaration errorQuote:
CPP / C++ / C Code:
Also, don't bump. Suddenly I don't feel that helpful. |
|
#4
|
||||
|
||||
Re: Two or more data types in declaration errorQuote:
Kimmo's help should be obvious, however, sometimes it is the most obvious things that we can't find. Perhaps a question? How can a function return both a "void" and a "double" at the same time? MxB |
|
#5
|
|||
|
|||
Re: Two or more data types in declaration errorQuote:
But bumping threads after 50 minutes as if we have no life at all is sometimes too much to take. Anyway... After taking a longer look at your code I feel like you might be better of starting the whole thing from scratch. Or you might not, it probably depends on what your aim is with this. A few things I noticed by looking at it: CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
Also note that your have a semicolon after the closing brace for if. That makes this equal to CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
Are you really supposed to use all those functions? I mean, many seem like they are there just for the sake of having functions. |
|
#6
|
|||
|
|||
Re: Two or more data types in declaration errorYa the code does kinda seem like a big ol' mess maybe i'll start from scratch, but thank you your input ill be sure to incorporate that into the next set of code.
|
|
#7
|
|||
|
|||
Re: Two or more data types in declaration errorI re-did the code up to this point and am now lost;
CPP / C++ / C Code:
It runs but after I input Y it prints validshapes, and then stops. I dont know If i am leaving something out, but the program stops at this function CPP / C++ / C Code:
Last edited by admin : 14-Jun-2012 at 10:02.
Reason: Please insert your example C/C++ codes between [CPP] and [/CPP] tags
|
|
#8
|
|||
|
|||
Re: Two or more data types in declaration error----end thread----
|
|
#9
|
|||
|
|||
Re: Two or more data types in declaration errorDid you get this to work? I am doing this same assignment.
|
|
#10
|
||||
|
||||
Re: Two or more data types in declaration errorQuote:
Does any body know what the assignment is? The assumption that it must calculate the area of various shapes is fairly obvious, but are there any "rules" or other requirements? The code presented here is not horrible, considering that it is from someone just learning the language, but it is fairly awful. I'd suggest that you look at it as an example of what not to do. MxB |
Recent GIDBlog
Running Linux Programs at Boot Time by gidnetwork
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compiling C btrieve programs in VS 2005 | emanresu | C Programming Language | 1 | 16-Nov-2009 03:19 |
| Error C2143: syntax error : missing ';' before '.' | kiranpreddy05 | MS Visual C++ / MFC Forum | 1 | 05-Nov-2009 07:39 |
| Memory leak when nothing is happening... How can I even debug this ? | Algar | MS Visual C++ / MFC Forum | 10 | 19-Nov-2007 07:17 |
| Major newbie problem | cynack | MS Visual C++ / MFC Forum | 1 | 08-Apr-2007 11:25 |
| Help with syntax errors | PeteGallo | C Programming Language | 7 | 08-Aug-2005 20:30 |
Network Sites: GIDNetwork · GIDApp · GIDSearch · Learning Journal by J de Silva, The