-
August 9th, 2013, 05:20 AM
#16
Re: Is there such a thing as code withdrawal in a compiler?
Originally Posted by riechan
Which is odd, because it was working properly with the deposit function. Then again, I didn't really compare x and acct.bal in deposit().
Please get a real development system that has a debugger, or start learning how to use the debugger in the environment you're using. If your environment doesn't have a debugger, throw it away and get one that does have a debugger.
You can't muse over code thinking that things are happening or not happening. You can't write programs this way. You have to learn how to use a debugger so you know what is being done, and not just guess. Without a debugger, it becomes trial and error coding, where the trials may never end. A debugger gives you an exact representation of what your program is doing, so that you can pinpoint what needs to be fixed or adjusted.
What if your program becomes hundreds or thousands of lines? No human being can keep track of thousands of loops, variables, if statements, etc. or the flow of a complex program when given certain input by eyeballing code. In addition, the debugger will help you learn what your program is doing.
Regards,
Paul McKenzie
Last edited by Paul McKenzie; August 9th, 2013 at 05:29 AM.
-
August 9th, 2013, 05:44 AM
#17
Re: Is there such a thing as code withdrawal in a compiler?
Originally Posted by riechan
EDIT2: I changed the values to integer, but it still did not compare properly. Odd.
The program is working as written! See my post #15!
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
August 9th, 2013, 05:55 AM
#18
Re: Is there such a thing as code withdrawal in a compiler?
It's okay now. Solved it! I'm such a scatterbrain! hahaha
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|