C# long

long is a 64 bit signed number, ranges from -9223372036854775808 ~ -9223372036854775807, -263 to 263.

long l = 91415926829;

long and string conversions.
using System.Windows.Forms;
long l = 91415926829;
string str = l.ToString();
MessageBox.Show(str); //91415926829
str = "91415926829";
long j = long.Parse(str);
MessageBox.Show(j.ToString()); //91415926829

long array:
long[] arr = {2, 5, 191415926829};
long sum = 0;
for (int i = 0;i < arr.Length; i++)
{
sum += arr[i];
}



endmemo.com © 2017  Terms of Use | Home