+ 2
Strange things in a basic calculator written in C program.
I have written a program for the Windows command prompt which consists of a calculator that performs basic operations (+,-,*,/) that receives as parameters: 1st operator, operand and 2nd operator, each separated by a space. During the debuggind, I made a block of code that list each one of the parameters given on the screen. The strange thing happens when I do a multiplication. The param that contains the sign (an * in this case) actually contains the name of the program (mycalc.exe). Why does this happen?
4 Réponses
+ 6
Hi, Ghost
it's impossible to precisely catch your program bug without seeing it. So, do a favor and copy and paste your code into the playground and attach it to this post. Most likely you'll get some good solutions and advice about your problem.
+ 6
Hi again Ghost
I've tried to emulate your code (I'm not familiar with Windows programming) in VC++ 2010 and I managed to rewrite your code in this way (It's hardcoded but I guess you can get the point):
https://code.sololearn.com/cAu0gBYsGnWr
+ 1
@Babak Sheykhan (PERS)
here is my code:
https://code.sololearn.com/cGUL0fhE4A2P/?ref=app