Hello i have a problem with c# Arrays. I need a array to store some data in there…
My Code is that
double[] ATmittelMin;
ATmittelMin[zaehlMittel] = Gradient(x, xATmax, y, yATmax);
But the compiler says: not defined var
How can i define a double array without a fixed size ?
Thanks a lot!
Best Answer
Arrays are always fixed in size, and have to be defined like so:
The
List<T>
class uses an array in the background and redefines it when it runs out of space:You can iterate through a
List<T>
just as you would an array: