VBA (and I assume VB) has a Variant type which I believe takes up more memory, but covers various data types.
Is there an equivalent in c# ?
In a windows form say I had the following, how would I amend the type of z so that it runs ok
private void uxConvertButton_Click(object sender, EventArgs e)
{
int x = 10;
byte j = (byte)x;
upDateRTB(j);
long q = (long)x;
upDateRTB(q);
string m = x.ToString();
upDateRTB(m);
}
void upDateRTB(long z) {
MessageBox.Show(this,"amount; "+z);
}
1 Answer