Here is my code and it gives red squiggly line under the variable of the array declaration, stating,
Fixed size buffer fields may only be members of struct
float is a value type, so I don't quite understand this message. What is the correct syntax to create public array of 13 elements (0 through 12; I ignore index 0)...
class clsUtility
{
public int UtilityId { get; set; }
public fixed float InterpolationFactorMonth[13]; // <-- HERE IS THE PROBLEM
}
public float[] InterpolationFactorMonth = new float[13];. As the error states, fixed arrays are only usable from structs, and usually only used with interop/marshalling scenarios where you need to pass the struct to some foreign unmanaged piece of code.