The only thing that I noticed is that you didn't include any of the headers in the portion that you posted. After adding LuckY's includes, it worked compiled fine for me. Post a list of your errors.
The only thing that I noticed is that you didn't include any of the headers in the portion that you posted. After adding LuckY's includes, it worked compiled fine for me. Post a list of your errors.
If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein
The errors I get are as follows:
I tried adding my complete program source for you too, but I think due to its size, it does not want to be added to this post. I will try to add it in a separate message and see if that works.Code:c:\dev-c_~1\examples\curren~1.cpp:663: `::ios_base' undeclared (first use here) c:\dev-c_~1\examples\curren~1.cpp:663: parse error before `::' c:\dev-c_~1\examples\curren~1.cpp: At top level: c:\dev-c_~1\examples\curren~1.cpp:686: ANSI C++ forbids declaration `USD_Menu' with no type c:\dev-c_~1\examples\curren~1.cpp:686: new declaration `int USD_Menu()' c:\dev-c_~1\examples\curren~1.cpp:55: ambiguates old declaration `void USD_Menu()' c:\dev-c_~1\examples\curren~1.cpp:687: parse error before `}' c:\dev-c_~1\examples\curren~1.cpp: In function `void USD_Menu()': c:\dev-c_~1\examples\curren~1.cpp:696: new declaration `void USD_Menu()' c:\dev-c_~1\examples\curren~1.cpp:686: ambiguates old declaration `int USD_Menu()'
This didn't work, do you have any suggestions? Should I include the program as a *.zipped attachment? If I do send it that way, do I need the code tags for this file too?
Sure, add a zip file. It doesn't need code tags.
If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein
Here is a *zipped version of my program. I hope that this helps. Just as a reminder, I am using Dev-C++ version 4 as my compiler.
Why does this look like your previous question?
http://cboard.cprogramming.com/showthread.php?t=59682
A perfect illustration of how not to write code IMO.
That being, you don't write hundreds of lines of code without pressing compile, then worry about whether it's too big or not to dump on a message board for someone else to figure out.
The point being that if errors suddenly appear, you've got a pretty good idea that it's got something to do with the 10 lines you just added.Code:do { write_10_lines_of_code(); while ( compiler_returns_errors() ) { fix_code_you_just_added(); } } while ( program_not_finished() );
> c:\dev-c_~1\examples\curren~1.cpp:663
600+ lines huh?
It's perfectly acceptable to create another project to test new ideas in to make sure you understand them fully, before trying to integrate them into your main project.
At least then if it all goes wrong, you have something more manageable to post to the board.
AQWst
Dont "throw your toys out of the pram" and send a moderator report for a response that you dont like. There's nothing "mean and nasty" about that reply, you should try to look at the response constructively and take in what's said.
Well, the only error is that somewhere around line 682, you have this:That will compile if you change it to this:Code:} return 0; } USD_Menu(); }Looks like you forgot a bit when you pasted. I make no guarantees as to the logical operation of this program. Run it and tell us if there's any more problems.Code:} USD_Menu(); return 0; }
You might consider breaking your code up into a few different source code files. For instance, putting each nation's menu into a different file would help, as well as putting all the conversion constants into a header file.
Last edited by pianorain; 12-21-2004 at 10:15 AM.
If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein
I would echo Fordys point and would add that you are a new member. Telling us mods, who have been here for years what we do and don't need is "a trifle arrogant?"
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
Aside from that error pianorain mentioned, there are no syntactic errors. I am not a user of DevC++ but since using ios::in worked and ios_base::in doesn't, I'd recommend giving the former a try over the latter.
As an aside, your code could be streamlined considerably. You have the same blocks of code repeating throughout the entire file. Instead of having twenty-someought menus you could have a single menu that displays it's contents based on what current menu you are on (btw, your menus have too many rows to be displayed in a standard 80x25 screen).
I have the program compile down to two errors now. They are:
Code:c:\dev-c_~1\examples\curren~1.cpp:663: `::ios_base' undeclared (first use here) c:\dev-c_~1\examples\curren~1.cpp:663: parse error before `::'
FYI, the program worked with all of the lines of code I added prior to adding the logic to read the *.csv file. This is the logic I added to hopefully remove the constants I have set up for each of the conversions.
See my previous post about that problem.
I added a little bit to your code to demonstrate how you can simplify your code considerably. Keep in mind it is only a start. Use the principles I've employed to revise your entire program. Good luck.
Here's the revised version. Just search for "lucky" to see where I made changes.