The following segment of code kind of confused me .
When I was trying to compile these code , the vS2010 throw an error about type int16 cannot convert into short.
But it seems like the same type.
So I took a test about it.
The type what I got is 「int32」!
Could someone tell me what it is happening ??
private void button1_Click(object sender, EventArgs e)
{
Int16 nTemp = 1;
NumberTest(nTemp + 1);
}
private void NumberTest(Int16 v_nValue)
{
MessageBox.Show(v_nValue.ToString());
}
When I was trying to compile these code , the vS2010 throw an error about type int16 cannot convert into short.
But it seems like the same type.
So I took a test about it.
private void button1_Click(object sender, EventArgs e)
{
Int16 nTemp = 1;
MessageBox.Show((nTemp + 1).GetType().ToString());
}
The type what I got is 「int32」!
Could someone tell me what it is happening ??