0
Need help with a little Calculator in C#
Hey guys I´m new to Programming and i´m experiencing some issues with a Windows-Console Calculator App that i tried to make. So it kinda works but whenever i try to calculate with something else than '+' i have to move one row or more lower in the Windows-Console. It´s hard to explain but maybe somebody knows what i mean. Below is the Code (includes some german) https://code.sololearn.com/cxlXOLblkPzH/#cs
4 ответов
+ 2
@Josh B. I have edited your code and add some comments to explain.
https://code.sololearn.com/ckh3RPmPFlo3/?ref=app
P.S. Just in case you didn't know, actually you can edit your original post, delete the snippet that was cropped, and paste the code URL in the Description text instead, would've looked better : )
+ 1
@Ipang thank you so much!! That obviously is a lot better than my version...
It helps a lot!
But there is one more question I have: Whats the difference in using the Equals Method instead of '==' ?
+ 1
@Josh B. You're welcome, glad if it helps. The == operator compares only the object reference rather than the content (the text), as I understand it, == is only reliable for comparing string literals (cmiiw), I can't explain in depth though. In Java apparently, a method by the same name is also used for the purpose, C# copied a lot of stuffs from Java : )
+ 1
Ah okay. Thanks again ;)