You are using two headers which prevents me from compiling this code, as I don't have them
You can get the second one from BS's page (it's just a mishmash of #includes, template functions,etc) http://www.stroustrup.com/Programming/std_lib_facilities.h
stdafx is needed for precompiled headers. If the OP doesn't have anything listed in there, you can skip it.
jonsca
Quantitative Phrenologist
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581
>>I think I got one of the logic, so there *should* only be 2 left.
Why two? If you know where the bugs are, you might want to tell us. We're not all clairvoyant here.
Nick Evan
Not a Llama
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
>>If there are three logic bugs in total and one's down, two are left.
Holy shit. That's some amazing math!
Although you obviously think otherwise: I'm not stupid. I was asking where the two remaining errors are.
Nick Evan
Not a Llama
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
>> I have debugged the syntax errors and now need help with the logic. I think I got
>> one of the logic, so there *should* only be 2 left.
So, if you've gotten the code to compile, it might be worth testing its functionality to see where it goes wrong.
I.e. run very simple tests such as;
1 + 1;
2 * 2;
and so on.
PS. If you already haven't, then try to configure your compiler to produce as many warnings as possible - that might help too.
mitrmkar
Posting Virtuoso
1,809 posts since Nov 2007
Reputation Points: 1,105
Solved Threads: 395
>>If there are three logic bugs in total and one's down, two are left.
Holy shit. That's some amazing math!
Although you obviously think otherwise: I'm not stupid. I was asking where the two remaining errors are.
I think he got this code from the book. And the book probably said there was x amounts
of errors in the code. And so, he is left hunting for them. Thats why, he maybe saying there are 2 errors left.
firstPerson
Senior Poster
3,923 posts since Dec 2008
Reputation Points: 841
Solved Threads: 608
I think he got this code from the book. And the book probably said there was x amounts
of errors in the code. And so, he is left hunting for them. Thats why, he maybe saying there are 2 errors left.
You're right, it even says so in the code. But I never read the code because the question wasn't clear, so: whoopsie :S
Anyway: I compiled the code and I can't get one single calculation out of it. There are still quite a few things things wrong with this code. Could you indicate which things you've already changed? Maybe you accidently introduced some new bugs in the code, while removing others? I don't own the book, so I can't check.
Nick Evan
Not a Llama
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403