View Single Post
Old 09-11-2008, 07:56 PM   #1 (permalink)
Oreo
 
010011010110000101111000

Join Date: Dec 2006

Location: Leicester, England

Posts: 3,660

Oreo will become famous soon enoughOreo will become famous soon enough

Send a message via MSN to Oreo
Default Quick Nooby Question, C#

Okay so i'm running through some tutorials, and the guy goes on to explain how to do a very basic calculator.

So he goes though how to do it all and i end up with this:


int firstTextBox = 0;
int secondTextBox = 0;
int result = 0;

firstTextBox = int.Parse (textBox1.Text);
secondTextBox = int.Parse (textBox2.Text);

result = firstTextBox + secondTextBox;
label1.Text = result.ToString();

It works, but i'm just wondering that howcome no matter what i change the:


int firstTextBox = 0;
int secondTextBox = 0;
int result = 0;

0 numbers to it still works, even if i do this:


int firstTextBox = 7;
int secondTextBox =12;
int result = 4;

It will still work properly as a calculator, so i guess what im asking out of curiosity is what do them three 0's actually represent ?
Oreo is offline