|
-
January 21st, 2013, 12:53 PM
#8
Re: My calculator program keeps crashing at the end
 Originally Posted by Azomb
I started learning like two days ago... It was the only way I could think of this working. And so it can respond with "Nice, what are you (adding/subtracting/multiplying/dividing) 5 by?"
Following your design, you could have a GetAandC() function. After you find out which operation the user wants, set up an if or switch statement like
Code:
if(b == "*")
Multiply();
else
if(b == "/")
Divide();
...
Also, you really need to forget you've even heard of the goto statment. NO respectable C++ programmer would use it. Learn how to use while and for loops to repeat operations.
Also, when posting, please use CODE tags to preserve formatting.
Tags for this Thread
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
|