The correct syntax should be:
int count, xmin, xmax, ymin, ymax = 0;
EDIT:
Your original code seems to work no?
EDIT2:
Well ofcourse that won't work in a field initializer!
A field initializer cannot refer to other instance fields.
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/fields
You can probs move the init code to your constructor if you really want - something like:
int count = 3, xmin, xmax, ymin, ymax;
void MyCtor()
{
xmin = xmax = ymin = ymax = count;
}
Assign same value to multiple variables in a single line could be done in the following way
int count, xmin , xmax , ymin , ymax;
count = xmin = xmax = ymin = yman = 0;
Or like this
int count, xmin, xmax, ymin, ymax = 0;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.