What is the equivalent of Java's .length for arrays in C#?
- by Michael Loftus
I'm new to C#, and I'm trying to convert this code from java into C#.
static public double euclidean_2(double[] x, double[] y)
{
if (x.length != y.length) throw new RuntimeException("Arguments must have same number of dimensions.");
double cumssq = 0.0;
for (int i = 0; i < x.length; i++)
cumssq += (x[i] - y[i]) * (x[i] - y[i]);
return cumssq;
}
I know java uses .length but what is the equivalent in C# since I keep getting an error
Thanks